zoukankan      html  css  js  c++  java
  • ListView的item里面控件文本颜色修改

     1     @SuppressLint("InflateParams")
     2     @Override
     3     public View getChildView(int groupPosition, int childPosition,
     4             boolean isLastChild, View convertView, ViewGroup parent) {
     5         ChildHolder childHolder = null;
     6         if (convertView == null) {
     7             childHolder = new ChildHolder();
     8             convertView = inflater.inflate(R.layout.activity_event_item_item, null);
     9             childHolder.textView_Child = (TextView) convertView.findViewById(R.id.tv_item);
    10             convertView.setTag(childHolder);
    11         } else {
    12             childHolder = (ChildHolder) convertView.getTag();
    13         }
    14         childHolder.textView_Child = (TextView) convertView.findViewById(R.id.tv_item);
    15 
    16         //-----------------------------------------------------------
    17         childHolder.textView_Child.setText(childList.get(groupPosition).get(childPosition));
    18         if (isLastChild) {
    19             childHolder.textView_Child.setGravity(Gravity.RIGHT);
    20             childHolder.textView_Child.setTextColor(convertView.getResources().getColor(R.color.red_weixin));
    21         } else {
    22             childHolder.textView_Child.setTextColor(convertView.getResources().getColor(R.color.black));
    23         }
    24         //-----------------------------------------------------------
    25         return convertView;
    26     }
  • 相关阅读:
    django文件上传
    django验证码
    auth模块---笔记
    css笔记
    django模板系统---2
    django模板系统
    Django中间件
    前端笔记---1
    我的django笔记---1
    DNS服务器的搭建
  • 原文地址:https://www.cnblogs.com/ErrStr/p/5585901.html
Copyright © 2011-2022 走看看