android - Not all elements are displayed on smaller screens -
i have linear layout edittext , buttons. , when running app on smaller screens, layout gets cutting off (not elements displayed). i've added <supports-screens ...>
in manifest, it's still not working. there way display elements?
edit: code:
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <textview android:id="@+id/textview1" android:layout_width="match_parent" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:textstyle="bold" android:text="@string/tx" /> <textview android:id="@+id/textview2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/tx1" android:textappearance="?android:attr/textappearancemedium" /> <edittext android:id="@+id/edittext1" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:hint="@string/ed1" android:inputtype="number" > <requestfocus /> </edittext> <textview android:id="@+id/textview3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/tx2" android:textappearance="?android:attr/textappearancemedium" /> <edittext android:id="@+id/edittext2" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/ed2" android:inputtype="textcapcharacters|textautocorrect" android:ems="10" /> <textview android:id="@+id/textview4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/tx3" android:textappearance="?android:attr/textappearancemedium" /> <edittext android:id="@+id/edittext3" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/ed3" android:inputtype="textcapcharacters|textautocorrect" android:ems="10" /> <radiogroup android:id="@+id/radiogroup1" android:layout_width="wrap_content" android:layout_height="wrap_content" > <radiobutton android:id="@+id/radio1" android:layout_width="304dp" android:layout_height="wrap_content" android:checked="true" android:text="@string/radiotx1" /> <radiobutton android:id="@+id/radio2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/radiotx2" /> <radiobutton android:id="@+id/radio3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/radiotx3" /> </radiogroup> <button android:id="@+id/button1" android:layout_width="match_parent" android:layout_height="wrap_content" android:onclick="dosomething" android:text="@string/bt1" />
you should create sure create layouts flexible possible. includes using things relativelayouts, , things layout_weight. can preview layouts in android layout editor changing screen size ... ensures behave expected on smaller (or larger) screen sizes.
the mindset should similar web developers making responsive layouts. great documentation/guidance google can found here: http://developer.android.com/training/multiscreen/screensizes.html
android android-layout android-screen-support
No comments:
Post a Comment