android动态布局 android如何实现动态添加布局?
android如何实现动态添加布局?代码如下:LinearLayout layout=new LinearLayout(this)textview TX=new textview(this)发送设置文
android如何实现动态添加布局?
代码如下:LinearLayout layout=new LinearLayout(this)textview TX=new textview(this)发送设置文本(“我动态添加了它”)布局.addView(TX)setcontentview(布局)动态添加线性布局,并在版面中添加一个textview
每次单击按钮阅读版面文件时,使用版面充气器,然后在版面文件中找到每个视图。视图操作完成后,它将被加载到布局文件中,以放置在setcontentview方面。每次动态加载文件时,必须调用removeallviews方法来清除以前加载的视图。