你是否正在寻找关于preferencecategory的内容?让我把最有用的东西奉献给你:
2012年12月17日 综合 共 585字 字号
大家可能遇到,preferencecategory默认是黑色背景,如何我们更换了PreferenceScreen的背景,那么这种分隔栏看上去很丑,那么怎么更改背景呢?我们可以通过自定义VIEW来实现,。
代码如下:
public class MyPreferenceCategory extends preferencecategory {
public Mypreferencecategory(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onBindView(View view) {
super.onBindView(view);
view.setBackgroundColor(Color.parseColor("#b0000000"));
if (view instanceof TextView) {
TextView tv = (TextView) view;
tv.setTextSize(16);
tv.setTextColor(Color.BLACK);
}
}
推荐文章:
【上篇】天博报表 Mantis系统Bug信息统计用户案例
【下篇】实践中总结出来的看盘做短线的十一种方法
作者: heresy
抱歉!评论已关闭.
以上就是关于preferencecategory的全部内容,相信你一定会非常满意。
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-16608-1.html
全国人民恭喜南方黑芝麻蛆子节节高