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"/>

更多相关文章

  1. android shape 常用到属性的设置
  2. Android(安卓)uiautomator 使用入门官方教程
  3. cxf android客户端简单访问
  4. Android控件之ImageView,Button, ImageButton
  5. 使用ListView应该注意的地方
  6. Android(安卓)Design Support Library的代码实验
  7. Android——控制UI界面
  8. android布局属性详解
  9. Android(安卓)pthread mutex 实现分析

随机推荐

  1. android下联网
  2. 【ArcGIS Android(安卓)10.2.9】5. WMSLa
  3. Android中的SQLite使用
  4. Android(安卓)PinnedSectionListView异常
  5. 8、RxJava+Retrofit+okhttp上传多张图片
  6. Android(安卓)在线升级APK
  7. android drawable setBounds()
  8. android: MapView加载多个 overlay 内存
  9. android录音实现
  10. android按键两次退出程序