まず第一に、答えを求めて Web をさまよいましたが、問題を解決できませんでした。
レイアウト内に次のスクロール ビューがあります。
<ScrollView
android:id="@+id/scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<ImageView
android:id="@+id/img_cover_picture"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="12dp"/>
<LinearLayout
android:id="@+id/list_flags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignBottom="@id/img_cover_picture"
android:layout_marginBottom="-12dp"
android:orientation="horizontal"
/>
<TextView
android:id="@+id/txt_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/img_cover_picture"
android:gravity="center_horizontal"
android:textColor="#F5F5F5"
android:textSize="28sp" />
<TextView
android:id="@+id/list_infos"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@id/txt_title"
android:textColor="#BABBBB"
/>
<LinearLayout
android:id="@+id/view_blog_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@id/list_infos"
android:layout_marginTop="8dp"
android:orientation="horizontal"
/>
<TextView
android:id="@+id/txt_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/view_blog_count"
android:gravity="center_horizontal"
android:textColor="#F5F5F5"
android:textSize="18sp" />
<LinearLayout
android:id="@+id/list_categories"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/txt_description"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:orientation="horizontal"
/>
</RelativeLayout>
</ScrollView>
空の LinearLayouts は、プログラムによって埋められます。
私が期待しているのは、RelativeLayout に表示されるコンテンツが大きすぎる場合、ScrollView を使用すると、ユーザーはスクロールしてすべてのコンテンツを表示できるようになることです。
問題は、それが発生したときにスクロールできますが、最後の LinearLayout (list_categories で識別される) が表示されないことです。私はあらゆる種類のことを試しました:
- プログラムで埋められたので、空だったのでしょうか?確認のため@id/view_blog_count以下に入れてみたところ、表示されました(説明を重ねて表示)
- set fillViewport を true に設定してみました
- 重みを変えてみました
- レイアウト(_width|_height)で遊んでみました
- ...
これまでのところ成功していません:(
ご協力いただきありがとうございます!
ガストン
アップデート
LinearLayouts が空であることは知っていますが、プログラムで埋められています (そして、そうであると確信しています)。さらに、テストとして空の LinearLayout に TextView を追加しようとしましたが、LinearLayout はまだ非表示でした。
更新 2
フラグ (list_flags) がカバー画像 (img_cover_picture) の上にあるように、RelativeLayout を使用しています。ただし、@lelloman が示唆したように、代わりに水平方向の LinearLayoout を試してみました。それでもうまくいきませんでした:)