<RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/suibiankankan" android:text="随便看看"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentTop="true"
android:layout_marginLeft="20dp" />
<ImageView android:src="@drawable/triangle" android:id="@+id/arrow1"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true" android:layout_marginRight="20dp" />
<View android:layout_width="fill_parent" android:layout_height="1.0dip"
android:background="@drawable/horizontal_separation_line"
android:layout_below="@id/suibiankankan" android:layout_marginTop="10dp" />
</RelativeLayout>
让这个小布局在被点击的时候背景变颜色,最好是用图片做背景的那种,纯用UI 不用Activity
拜托了~
android:layout_height="wrap_content">
<TextView android:id="@+id/suibiankankan" android:text="随便看看"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentTop="true"
android:layout_marginLeft="20dp" />
<ImageView android:src="@drawable/triangle" android:id="@+id/arrow1"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true" android:layout_marginRight="20dp" />
<View android:layout_width="fill_parent" android:layout_height="1.0dip"
android:background="@drawable/horizontal_separation_line"
android:layout_below="@id/suibiankankan" android:layout_marginTop="10dp" />
</RelativeLayout>
让这个小布局在被点击的时候背景变颜色,最好是用图片做背景的那种,纯用UI 不用Activity
拜托了~
解决方案 »
- 请问你们用哪家的包来实现定位啊
- 【求助】android模拟器调试不了啊。急
- 请问android开发framework层组件的环境搭建?
- 使用notifyDataSetChanged()无法更新视图
- android 录制声音 播放有噪音?
- the jar file D:/xxx/android.jar has no source attachment
- 有没有这样的方法String.format("aaa%d, bbb%d, ccc%d", "我","你", “他”);
- ActionBarShelock shareAction
- 安卓通过。netWebservice 获取json数据 在listview显示不出来
- Program type already present: android.support.v4.app.BackStackRecord$Op
- 简单的java问题
- 如何返回到home界面?
android:layout_height="wrap_content">
加一个android:background="@drawable/testdrawable"
然后在drawable文件夹下面放一个xml文件testdrawable.xml
testdrawable.xml的布局:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/img1" />
<item android:state_pressed="false"
android:drawable="@drawable/img0" />
<item android:drawable="@drawable/img0" />
</selector>