android - How to make sure spinners fit in the screen size? -
with layout:
<?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/user_pro_main_view" android:layout_width="fill_parent" android:layout_height="match_parent" > <linearlayout android:layout_width="match_parent" android:layout_height="1100dp" android:orientation="vertical" > [ ... ] <tablelayout android:id="@+id/personalinfogrid" android:layout_width="match_parent" android:layout_height="wrap_content" > <tablerow android:id="@+id/rowname" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:id="@+id/textname" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/layout_name" android:textappearance="?android:attr/textappearancemedium" /> <edittext android:id="@+id/editname" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="10" android:inputtype="text" > <requestfocus /> </edittext> </tablerow> <tablerow android:id="@+id/rowuploadphotos" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:id="@+id/textuploadphotos" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/layout_upload_photos" android:textappearance="?android:attr/textappearancemedium" /> <spinner android:id="@+id/spinuploadphotos" android:layout_width="wrap_content" android:layout_height="wrap_content" android:entries="@array/upload_photos_num_array" /> </tablerow> <tablerow android:id="@+id/rowinterest" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:id="@+id/textinterest" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/layout_interest" android:textappearance="?android:attr/textappearancemedium" /> <spinner android:id="@+id/spininterest" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </tablerow> <tablerow android:id="@+id/rowage" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:id="@+id/textage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/layout_age" android:textappearance="?android:attr/textappearancemedium" /> <spinner android:id="@+id/spinage" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </tablerow> <tablerow android:id="@+id/rowfirstchat" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:id="@+id/textfirstchat" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/layout_first_sex_rel" android:textappearance="?android:attr/textappearancemedium" /> <datepicker android:id="@+id/firstchatdate" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </tablerow> i this:

as can see on simulator screen capture attached, spinners large, , won't fit in screen real estate. on real device, behavior identical.
for tablerow contains spinner, replace linearlayout (horizontal orientation) , give layout_weight textview (60) , spinner(40).
Comments
Post a Comment