DefaultSectionAdapter.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:UltimateAndroid 作者:
@Override
@SuppressWarnings(value = { "deprecation" })
public View getItemView(int section, int position, View convertView, ViewGroup parent) {
    TextView tv = null;
    if (convertView != null) {
        tv = (TextView) convertView;
    } else {
        tv = new TextView(context);
        RectShape rs = new RectShape();
        ShapeDrawable sd = new  BottomBorderBackground(rs, Color.WHITE, Color.GRAY);
        tv.setBackgroundDrawable(sd);
        tv.setPadding(20, 0, 0, 0);
        tv.setGravity(Gravity.CENTER_VERTICAL);
    }
    tv.setLayoutParams(new LayoutParams(300, itemHeight));
    tv.setText("s" + section + " p" + position);
    return tv;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号