ただし、次の画面レイアウトを作成しようとしています。
- いくつかの TextView を含む行
- ユーザー アクションがビューを追加または削除するスクロール ビュー
- ボタンライン。
1.や3.は問題ないのですが、2.は困ります。私のスキームは次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainX"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/labels"
android:layout_weight="1">
<!--Some text view of various sizes -->
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/dataScroll">
<LinearLayout
android:id="@+id/dataShow"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/buttons"
android:layout_weight="1">
<!--some buttons-->
</LinearLayout>
</LinearLayout>
プログラムを実行すると、ボタンの行が画面の中央にあり、画面に要素を追加すると(dataShowレイアウトでaddViewを使用)、最初の要素は問題なく追加されますが、その後はわかりません何が起こっている。
ありがとう