I made an Android app for which i wrote the following xml code .It’s showing up properly in big devices but not showing in smaller devices such as galaxy y.So i want to make my
code dynamic so that it can be displayed in all devices.
<?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" >
<ImageView
android:id="@+id/ivReturnedPic"
android:layout_width="fill_parent"
android:layout_height="250dp"
android:layout_gravity="center"
android:src="@drawable/back" />
<Button
android:id="@+id/ibtakePic"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="click to snap" />
<TextView
android:id="@+id/tvDisplay"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:layout_gravity="center"
android:background="#EEEEEE"
android:gravity="center"
android:text="Fool Around By Clicking Test"
android:textColor="#0000ff"
android:textSize="35dp" />
<Button
android:id="@+id/test"
android:layout_width="344dp"
android:layout_height="101dp"
android:text="test" />
Test button is not shown as remaining items in the view are taking up the whole screen. You should use ScrollView so that the screen becomes scrollable and handle varying screen sizes.