android ui imagebutton
16lz
2021-12-04
drawable/imagebutton.xml<?xml version="1.0" encoding="utf-8"?><selectorxmlns:android="http://schemas.android.com/apk/res/android"><itemandroid:state_focused="true"android:state_pressed="false"android:drawable="@drawable/btnfocused" /><itemandroid:state_focused="true"android:state_pressed="true"android:drawable="@drawable/btnfocusedpressed" /><itemandroid:state_focused="false"android:state_pressed="true"android:drawable="@drawable/btnpressed" /><item android:drawable="@drawable/btndefault" /></selector>然后,在main.xml 中将advancedbutton 赋值给Button 组件中background 的属性。layout/main.xml<Buttonandroid:id="@+id/myButton1"android:background="@drawable/ imagebutton "android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="@string/str_button1"/>
更多相关文章
- android shape 常用到属性的设置
- Android(安卓)uiautomator 使用入门官方教程
- cxf android客户端简单访问
- Android控件之ImageView,Button, ImageButton
- 使用ListView应该注意的地方
- Android(安卓)Design Support Library的代码实验
- Android——控制UI界面
- android布局属性详解
- Android(安卓)pthread mutex 实现分析