Android—改变LinearLayout背景颜色
2015-01-30 20:01
288 查看
原创为公司的同事
//获取id ,PoiSearchappointmentsuccessfulactivity.是当前的activity,改成你自己的就行
LinearLayout layouttwo=(LinearLayout)PoiSearchappointmentsuccessfulactivity.this.findViewById(R.id.layouttwo);
//设置属性,R.color.use_buttoncolor是在color文件中定义好的
layouttwo.setBackgroundColor(PoiSearchappointmentsuccessfulactivity.this.getResources().getColor(R.color.end_color_2));
tv_recommended.setBackgroundColor(PoiSearchappointmentsuccessfulactivity.this.getResources().getColor(R.color.use_buttoncolor));
}
//获取id ,PoiSearchappointmentsuccessfulactivity.是当前的activity,改成你自己的就行
LinearLayout layouttwo=(LinearLayout)PoiSearchappointmentsuccessfulactivity.this.findViewById(R.id.layouttwo);
//设置属性,R.color.use_buttoncolor是在color文件中定义好的
layouttwo.setBackgroundColor(PoiSearchappointmentsuccessfulactivity.this.getResources().getColor(R.color.end_color_2));
tv_recommended.setBackgroundColor(PoiSearchappointmentsuccessfulactivity.this.getResources().getColor(R.color.use_buttoncolor));
}
相关文章推荐
- Android LinearLayout使用selector改变交互时背景颜色
- Android LinearLayout 点击背景颜色改变
- Android LinearLayout使用selector改变交互时背景颜色
- android LinearLayout 单击动态改变背景
- Android的LinearLayout中 selector背景颜色
- Android的LinearLayout中 selector背景颜色
- android LinearLayout 单击动态改变背景
- Android关于LinearLayout和RelativeLayout背景设置的区别
- android 修改Layout背景的颜色
- 利用Android的传感器改变背景颜色
- android背景颜色渐变及改变title颜色 shape
- android gridview点击子选项动态改变item背景颜色
- 点击textview 使用selector改变对应viewGroup(LinearLayout,RelativeLayout)的背景
- Android如何让TextView子元素随着父元素的背景变化而改变字体颜色?
- Android中使用代码改变背景颜色
- android状态栏一体化(改变状态栏的背景颜色)开源工程推荐
- Android下ListView上下滑动背景颜色改变
- 改变Android的hello world程序字体颜色和背景颜色
- android LinearLayout自定义高亮背景
- Android LinearLayout 渐变背景