亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Android-動態地將視圖添加到視圖中

Android-動態地將視圖添加到視圖中

慕絲7291255 2019-06-23 16:56:52
Android-動態地將視圖添加到視圖中我有個景觀布局-<LinearLayout     xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:padding="0px"     android:orientation="vertical">     <TextView         android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:id="@+id/items_header"         style="@style/Home.ListHeader" />     <TextView          android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:id="@+id/items_none"         android:visibility="gone"         style="@style/TextBlock"         android:paddingLeft="6px" />     <ListView          android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:id="@+id/items_list" /></LinearLayout>我想做的是,在我的主要活動中做這樣的布局<LinearLayout     xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:padding="0px"     android:id="@+id/item_wrapper"></LinearLayout>我想循環遍歷我的數據模型,并將包含第一個布局的多個視圖注入主布局中。我知道我可以通過在代碼中完全構建控件來實現這一點,但是我想知道是否有一種方法可以動態地構建視圖,這樣我就可以繼續使用布局,而不是把所有的東西都放在代碼中。
查看完整描述

3 回答

  • 3 回答
  • 0 關注
  • 551 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號