I’m writing an Android application. Here is it’s XML layout :
<ScrollView android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="left|top|bottom|right"
android:layout_marginTop="80dip"
android:layout_marginLeft="0dip"
android:layout_marginRight="0dip"
android:layout_marginBottom="60dip"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/centerlayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="left|right|top|bottom"
android:layout_marginRight="20dip"
android:layout_marginLeft="10dip"
android:layout_marginBottom="120dip" >
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow>
<Button android:text="Button"
android:layout_column="0"
android:id="@+id/bookmarkbutton"
android:layout_width="230dip"
android:layout_height="30dip"
android:background="@drawable/red_btn"
android:padding="14dp"
></Button>
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
and if I run it, it displays the following screen:

But when I add android:layout_gravity=”left” to the “Button”, the button size decreases and shows :

Please note if I change the width of button by android:layout_width=”30dip”, it shows small buttons,

but If I change it to bigger sizes, it does not apply the size correctly and the max width is the same as second image.
Finally If I add a new textview to it, via
ScrollView android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="left|top|bottom|right"
android:layout_marginTop="80dip"
android:layout_marginLeft="0dip"
android:layout_marginRight="0dip"
android:layout_marginBottom="60dip"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/centerlayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="left|right|top|bottom"
android:layout_marginRight="20dip"
android:layout_marginLeft="10dip"
android:layout_marginBottom="120dip"
>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/subjecttext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lineSpacingExtra="10dip"
android:padding="14dp"
/>
</TableRow>
<TableRow>
<Button android:text="Button"
android:layout_column="0"
android:id="@+id/bookmarkbutton"
android:layout_width="20dip"
android:layout_height="30dip"
android:background="@drawable/black_btn"
android:padding="14dp"
></Button>
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
It displays the following image, and the size of button no longer is changeable. Would you please tell me what’s wrong?

Try to use LinearLayout instead of TableLayout. Here your code with LinearLayout:
And Screenshot:
Hope, it help you!.
I actually see that your buttons in the button of screen have cropped text. Is this a second problem?
Bellow I attached screenshot with code: