0
私はAndroidでテーブルを作成しようとしています。 私は本当に遠いですが、私はHeadLineSumとBodySumに問題があります。 私は本当に欲しいものを表示するためにExcelのレイアウトを作った。テーブルテキストは右に整列します
私のAndroidのレイアウトコード:
<!-- Breakfast -->
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableRow
android:id="@+id/tableRowHeadlineBreakfast"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imageViewAddBreakfast"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_menu_add" />
<TextView
android:id="@+id/textViewHeadlineBreakfast"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="80"
android:text="@string/breakfast"
android:textSize="18sp" />
<TextView
android:id="@+id/textViewEnergyBreakfast"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="10"
android:text="@string/energy"
android:textSize="18sp" />
</TableRow>
</TableLayout>
<TableLayout
android:id="@+id/tableLayoutBreakfastItems"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableRow
android:id="@+id/tableRowBreakfastItems"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/textViewBreakfastItemsName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="80"
android:text="@string/name"
android:textSize="18sp" />
<TextView
android:id="@+id/textViewBreakfastItemsEnergy"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="10"
android:text="@string/energy"
android:textSize="18sp" />
</TableRow>
<TableRow
android:id="@+id/tableRowBreakfastItemsSub"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/textViewBreakfastItemsSub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/name" />
</TableRow>
</TableLayout>
<!-- //Breakfast -->
ありがとうございました。私はLinearLayoutでそれを行う方法を学ぶことにも興味があります。 – Solo
ようこそ。 –