ウェイトを使用してレスポンスレイアウトを作成しようとしていますが、この場合はスクロールビューも使用する必要があります。ウェイトとスクロール表示の線形レイアウト
これは、この時点で私のコードです:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".EncyclopediaFragment">
<!--Linear Container-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="100">
<!--Title Box-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="20"
android:orientation="horizontal"
android:weightSum="100">
<!--Empty Space-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5">
</LinearLayout>
<!--Text Box-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="95">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/encyclopedia_mosntersLabel"
android:gravity="center"
android:textAlignment="viewStart"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="40">
</LinearLayout>
</LinearLayout>
が、それはthisようにする必要があります。
レイアウトはウェイトに反応すると思われますが、同時にスクロールすることが可能にする必要があります。
私の質問は次のとおりです。ウェイトに応じてレイアウトを作成すると同時に、画像のようにスクロールできるレイアウトを作成するにはどうすればよいですか?
どのように多くのモンスターのとどのように多くのタワーの?私はグループとしての意味ですか?それはモンスターの1つのグループとタワーの1つのグループですか? – OBX
スクロールビュー内にレイアウトを配置するだけで済みます。以前はまったく同じ目的のために、グリッドレイアウトとリニアレイアウトの両方をウェイトで使用していました。 – ArchiFloyd
ここに部分的なヒントがあります。あなたのモンスターが横断するためには、テーブル行(幅=マッチ親、重心=中央)、各モンスター(幅= 0dp、重さ= 1).....を推薦します。 – seekingStillness