我在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。