代码中通过findViewById()获得Layout可以设置Orientation,但设置背景色无效
通过如下代码也可以修改背景色:
LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
LinearLayout linearLay = (LinearLayout) layoutInflater.inflate(R.layout.activity_main, null) ;
linearLay.setBackgroundColor(Color.WHITE);
setContentView(linearLay);
最后
以上就是寒冷铅笔最近收集整理的关于android 修改Layout背景的颜色的全部内容,更多相关android内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复