首页 > 其他 > 详细

relativeLayout按下换颜色背景

时间:2014-02-25 18:58:29      阅读:761      评论:0      收藏:0      [点我收藏+]

颜色背景xml<selector xmlns:android="http://schemas.android.com/apk/res/android">
        <item android:state_pressed="true" android:drawable="@color/rblue"/>
        <item android:state_focused="true"  android:drawable="@color/rblue"/>
    <item android:drawable="@color/white"/>
</selector>

使用该文件RelativeLayout 布局
<RelativeLayout
         android:layout_width="fill_parent"
             android:layout_height="50dip"
             android:gravity="center_vertical"

     android:clickable="true"
             android:background="@drawable/relatbg"
             >
</RelativeLayout>

relativeLayout按下换颜色背景

原文:http://www.cnblogs.com/chenjm/p/3565745.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!