我在xml
定義的佈局,它看起來像這樣:如何配置內部佈局編程
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/footer_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<!-- add views here -->
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app"/>
</LinearLayout>
我誇大它在我的活動內,但根據從數據RelativeLayout
需要有TextViews
應用程序。我怎麼可能擴展它並在其中添加不同的視圖?
注:這是從this question不同,因爲我試圖找出如何在不使用類我想要添加的內容擴展一個內 -layout。