I have problem with my table layout and TextView components. I don't know why I can't limit EditText and AutoCompleteTextView sizes and both components mess up my layout. As You can see on attached image below those components goes over screen edge (on the right side). Because of that spinner field is too large too.
I thought that android:layout_width="match_parent"
(or fill_parent
) should help, but not this time.
Layout code is below image.
I'll be grateful for any tips/help. I'm using HTC Wildfire S with Android 2.3.5.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView1"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:isScrollContainer="true"
android:overScrollMode="always"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbarStyle="outsideInset"
android:scrollbars="vertical">
<TableLayout
android:id="@+id/assiociatecode_tableleyout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:baselineAligned="true"
android:measureWithLargestChild="false" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/associatecode_lbl_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/associate_code_activity"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<EditText
android:id="@+id/associatecode_edit_code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="text" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/associatecode_lbl_product"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/associate_code_activity_product"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<AutoCompleteTextView
android:id="@+id/associatecode_edit_product"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@android:color/primary_text_light"
android:ems="10">
<requestFocus/>
</AutoCompleteTextView>
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/associatecode_lbl_productgroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/associate_code_activity_productgroup"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<Spinner
android:id="@+id/associatecode_edit_productgroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</TableRow>
</TableLayout>
</ScrollView>