代码中通过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);