TableRow textView packed together



I was trying to put three buttons in the same tableRow. The demonstration in Android Studio looks normal. However, after running it in an Android 4.3 (API level 18) cell phone, only the leftmost button is available to see, as the left picture shows.


Screenshot from cell phone API level 18Screenshot from Android Studio


The following are my xml code. Could you tell me what is the problem with the programs? Thank you.





<TableLayout xmlns:android="http://ift.tt/nIICcg"
xmlns:tools="http://ift.tt/LrGmb4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".QuizActivity">
<TableRow
android:layout_height="wrap_content"
android:layout_width="match_parent">
<TextView
android:id="@+id/questionTextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:singleLine="false"
android:maxLines="4"/>
</TableRow>
<TableRow
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<Button
android:id="@+id/true_button"
android:text="@string/true_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<Button
android:id="@+id/false_button"
android:text="@string/false_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<Button
android:id="@+id/chest_button"
android:text="@string/cheat_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</TableRow>

</TableLayout>



No comments:

Post a Comment