seletor android
来源:互联网 发布:淘宝网法院拍卖确认书 编辑:程序博客网 时间:2024/05/20 00:13
本例使用selector实现点击切换图片效果
public class MainActivity extends Activity {private Button bt;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);bt = (Button) findViewById(R.id.bt);}}
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.expandablelist_test.MainActivity" android:orientation="vertical"> <Button android:id="@+id/bt" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/imgselector" /></LinearLayout>selector中
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_pressed="true" android:drawable="@drawable/a"/> <item android:state_focused="true" android:drawable="@drawable/c"/> <item android:drawable="@drawable/b"/></selector>
0 0
- seletor android
- android Seletor的用法
- android seletor失效问题
- Android shape 和Seletor
- Seletor()
- Android 设置background(seletor)无效
- Android中XML绘图:Bitmap/Shape/Seletor和Layer
- 关于android中的drawable中seletor的使用
- Android 代码里动态设置TextView/Button等的文字颜色Seletor
- 关于ImageView的seletor设置
- shape与seletor状态选择器
- 代码 实现按钮 seletor shape 选择器等
- ViewPager圆点导航动态实现(利用seletor)
- seletor 字体颜色,选择状态修改中的遇到的坑
- 解决使用seletor点击改变背景时事件被上层布局获取的问题
- RecyclerView 条目单选----单选时改变文本的背景框形状(seletor)
- Android
- android
- nginx配置http请求重定向到https
- Best Time to Buy and Sell Stock II DP买卖股票
- 点卡充值(2)
- Word Ladder 字符的相似变化
- Android 键盘弹出和关闭事件
- seletor android
- /usr/bin/perl^M: 坏的解释器: 没有那个文件或目录
- Sum Root to Leaf Numbers 根节点到叶子组成数的和
- php通过统一发放tickets实现单点登陆SSO功能
- eclipse Indigo Helios Galileo几种版本的意思
- HDOJ 5222 Exploration
- OpenCascade开源库的使用
- Android 在应用中启动其他应用
- 【转】Druid、BoneCP、DBCP、C3P0等主流数据库对比