摘要: 目标:选中item,其字体设置为#3197FF,未选中的,其字体为#FFFFFF。其效果图如下:与listvew设置选中行item背景图片一样,使用selector,不过这里的颜色设置,应该是在listview中的textview中设置。<?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap 阅读全文
posted @ 2011-06-14 20:37 风倾清凌 阅读(30109) 评论(16) 推荐(1) 编辑
摘要: 目标:当item选中时,改变其背景图片。效果图如下:直接在listview的xml文件中使用listselector: <ListView android:id="@+id/listTV" android:layout_width="349px" android:layout_height="fill_parent" android:layout_marginLeft="26px" android:layout_marginTop="20px" android:listSelector=& 阅读全文
posted @ 2011-06-14 20:28 风倾清凌 阅读(14075) 评论(2) 推荐(0) 编辑
摘要: 目标:listview中item使用textview,当item选中时,字体为25px;当item未选中时,字体21px之前想了很久,以为同listview选中行字体颜色一样,使用xml文件中使用selector就可以改变了,但是一直上网查找资料,都没有找到selector中改变字体大小的命令。后来网友提醒我,可以在adapter中的getview中修改。现将重要的代码放上://全局变量,记录选中的item public static int select_item = -1;先使用全局变量记录选中的item,然后在listview的OnItemSelectedListener中实时更新选中的 阅读全文
posted @ 2011-06-14 10:26 风倾清凌 阅读(10730) 评论(5) 推荐(0) 编辑