Zajmuję się tworzeniem aplikacji dla systemu Android.Wyrównywanie przycisków wewnątrz TableRow
mam to:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="200px"
android:orientation="vertical">
<TextView
android:id="@+id/gameTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="left"
android:layout_margin="5px"
android:text="aaaaa"/>
<TextView
android:id="@+id/gameDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="left"
android:layout_margin="5px"
android:typeface="sans"
android:textSize="16sp"
android:textStyle="bold"
android:text="dddddd"/>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ButtonsTable"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:text="@string/yes"
android:id="@+id/playGame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:text="@string/no"
android:id="@+id/noPlayGame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</TableRow>
</TableLayout>
</LinearLayout>
Chcę umieścić przycisk playGame w lewym boku na środku przycisku noPlayGame w prawej części centrum.
Teraz oba są wyrównane na lewo od TableRow.
Jak mogę to zrobić?
Dziękuję.
EDIT: Dodałem kompletny układ i modyfikacje sugerowane przez Ashay.
2-ty EDIT:
ROZWIĄZANIE
Dodałem do TableLayout
następujące: android:stretchColumns="0,1"
. Teraz przyciski są ustawione centralnie, ale wypełniają swoją kolumnę entry!
Prawdopodobnie warto opublikować własną odpowiedź i oznaczać ją jako odpowiedź, tak aby nie pojawiała się na liście pytań bez odpowiedzi. –
Nie lubię odpowiadać na własne pytania. – VansFannel