私は3つの要素を持つレイアウトを持っており、その向きは「水平」です
レイアウトで各要素が占めるサイズを修正したいと思います。
最初の要素は合計スペースの40%を占め、次に2番目の要素は5%を占め、3番目の要素は残りの55%のスペースを占める必要があります。
私のレイアウトは次のようになります。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="100" >
<TextView
android:id="@+id/outletname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="40"
android:text="@string/outlet_name2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="5"
android:text=": " />
<TextView
android:id="@+id/outletnamevalue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="55"
android:text="abcdefttt" />
</LinearLayout>
</LinearLayout>
'TextView'のテキストは動的に変化するため、ビューのコンテンツに関係なく、要素のスペースを一定に保ちたいと思います。