Sunday, 13 July 2014

Android button refuses to reduce its size in a table?



I have a button that is in a table, but the button stretches across the screen, thereby stretching my image, making it ugly. I have tried wrap_content, fill_parent, and match_parent but they all give the same result. Here is my xml. Why doesn't the button reduce it's size???



<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://ift.tt/nIICcg"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/bg2"
android:orientation="vertical" >


<TableRow>
<ImageView
android:contentDescription="@string/contents"
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|top"
android:paddingTop="10dp"
android:src="@drawable/lesson1" />
</TableRow>

<TableRow>

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/alpha"
android:paddingLeft="15dp"
android:textAppearance="?android:attr/textAppearanceLarge" />

</TableRow>


<TableRow>
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="15dp"
android:textStyle="italic"
android:text="@string/alphanote"
android:textAppearance="?android:attr/textAppearanceMedium" />

</TableRow>


<TableRow>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/directions2"
android:paddingLeft="15dp"
android:textAppearance="?android:attr/textAppearanceMedium" />

</TableRow>

<TableRow>

<Button
android:id="@+id/Button1"
android:layout_width="14dp"
android:background="@drawable/playstart" />

</TableRow>

<TableRow>
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/alpha1"
/>

</TableRow>
</TableLayout>
</ScrollView>

No comments:

Post a Comment