如何以编程方式为线性布局设置背景颜色?我尝试了以下代码但无法正常工作:
LinearLayout footer = new LinearLayout(activity);
footer.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, 8));
footer.setBackgroundColor(Color.parseColor("##ffb5d6e1"));
((LinearLayout)v).addView(footer);