public void onItemClick(AdapterView<?> parent, View view, int arg2,
long arg3) {
//恢复每个单元格背景色
TextView categoryTitle;
for(int i=0;i<parent.getCount();i++)
{
categoryTitle = (TextView) parent.getChildAt(i);
categoryTitle.setTextColor(0XFFADB2AD);
categoryTitle.setBackgroundDrawable(null);
}
//设置选择单元格的背景色
categoryTitle=(TextView)view;
categoryTitle.setTextColor(0XFFFFFFFF);
categoryTitle.setBackgroundColor(R.drawable.categorybar_item_background);
?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_focused="true"
android:color="#ffffffff"/>
<item
android:state_pressed="true"
android:color="#ffffffff"/>
<item
android:state_selected="true"
android:color="#ffffffff"/>
<item
android:color="#ffabd2ad"/>
public void onItemClick(AdapterView<?> parent, View view, int arg2,
long arg3) {
//恢复每个单元格背景色
TextView categoryTitle;
for(int i=0;i<parent.getCount();i++)
{
categoryTitle = (TextView) parent.getChildAt(i);
categoryTitle.setTextColor(R.color.category_title_normal_background);
categoryTitle.setBackgroundDrawable(null);
}
//设置选择单元格的背景色
categoryTitle=(TextView)view;
categoryTitle.setTextColor(R.color.white);
categoryTitle.setBackgroundColor(R.drawable.categorybar_
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有