android中代码布局的问题
我想在代码中实现布局,其实是很简单的布局,但是还是出错,看了半天也没查处错误在哪,请大侠们帮忙看看,附上布局代码
:linearLayout = new LinearLayout(this);
setContentView(linearLayout);
linearLayout.setOrientation(LinearLayout.VERTICAL);
listViewShowMessage = new ListView(this);
llpListView = new LinearLayout.LayoutParams
(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
linearLayout.addView(listViewShowMessage, llpListView);
loadMore = new Button(this);
loadMore.setText("load");
loadMore.setId(1);
/*llpButton = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT);*/
linearLayout.addView(loadMore, llpButton);
listViewShowMessage.addFooterView(loadMore);
Logcat中报 ClassCastExceptions 不知道是什么原因造成的?
[解决办法]
报错,贴详细点出来哦
[解决办法]
linearLayout.addView(loadMore, llpButton);
listViewShowMessage.addFooterView(loadMore); 这重复了
[解决办法]