screen - Android Layout folder is not changing properly -
my android layout not changing layout folder on orientation change below layouts , permissions giving activity. default when open portrait or landscape working if change default portrait landscape or default landscape portrait not changing. there should not change layout structures , drawable using.
//my activity permission <activity android:name="com.pro.sample.distributor1" android:label="@string/app_name" android:configchanges="keyboard|keyboardhidden|orientation|screensize|screenlayout" android:windowsoftinputmode="adjustresize" > </activity> //this sw-600dp-port <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/distributor_main" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="10dip" android:background="@drawable/home_back" > <linearlayout android:id="@+id/row_1" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_margintop="10dp" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="zipcode:" android:textsize="22sp" android:textcolor="@color/white"/> <edittext android:id="@+id/search_zip_code" android:layout_width="150dp" android:layout_height="wrap_content" android:ems="10" android:layout_marginleft="20dp" android:background="@drawable/edit_field_back" android:maxlength="5" > <requestfocus /> </edittext> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="or" android:layout_marginleft="10dp" android:textsize="22sp" android:textcolor="@color/white"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="city:" android:textsize="22sp" android:adjustviewbounds="true" android:gravity="center_horizontal|center_vertical" android:layout_marginleft="20dp" android:textcolor="@color/white"/> <edittext android:id="@+id/search_city" android:layout_width="180dp" android:layout_height="wrap_content" android:ems="10" android:layout_marginleft="40dp" android:background="@drawable/edit_field_back" > <requestfocus /> </edittext> </linearlayout> <linearlayout android:id="@+id/row_2" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_margintop="20dp" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="state:" android:textsize="22sp" android:textcolor="@color/white"/> <spinner android:id="@+id/search_states" android:layout_width="180dp" android:layout_height="40dp" android:drawselectorontop="true" android:entries="@array/state_names" android:ems="10" android:layout_marginleft="50dp" android:background="@drawable/edit_field_back" > </spinner> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="miles:" android:textsize="22sp" android:adjustviewbounds="true" android:gravity="center_horizontal|center_vertical" android:layout_marginleft="20dp" android:textcolor="@color/white"/> <spinner android:id="@+id/select_miles" android:layout_width="180dp" android:layout_height="40dp" android:drawselectorontop="true" android:entries="@array/near_miles" android:ems="10" android:layout_marginleft="27dp" android:background="@drawable/edit_field_back" > </spinner> </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_margintop="20dp"> <button android:id="@+id/search_distributor" android:layout_width="100dp" android:layout_height="wrap_content" android:layout_gravity="center_vertical|center_horizontal" android:gravity="center" android:background="@color/white" android:text="search" android:textsize="22sp" /> <textview android:id="@+id/dist_head" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="distributors near you" android:textcolor="@color/white" android:layout_gravity="center" android:textstyle="bold" android:layout_margintop="10dp" android:textsize="25sp"/>" </linearlayout> <listview android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="wrap_content"> </listview> </linearlayout> //this sw-600dp-land <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/distributor_main" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="10dip" android:background="@drawable/home_back" > <linearlayout android:id="@+id/row_1" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_margintop="10dp" android:gravity="center" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="zipcode:" android:textsize="22sp" android:textcolor="@color/white"/> <edittext android:id="@+id/search_zip_code" android:layout_width="180dp" android:layout_height="wrap_content" android:ems="10" android:layout_marginleft="20dp" android:background="@drawable/edit_field_back" > <requestfocus /> </edittext> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="or" android:layout_marginleft="10dp" android:textsize="22sp" android:textcolor="@color/white"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="city:" android:textsize="22sp" android:adjustviewbounds="true" android:gravity="center_horizontal|center_vertical" android:layout_marginleft="20dp" android:textcolor="@color/white"/> <edittext android:id="@+id/search_city" android:layout_width="180dp" android:layout_height="wrap_content" android:ems="10" android:layout_marginleft="40dp" android:background="@drawable/edit_field_back" > <requestfocus /> </edittext> </linearlayout> <linearlayout android:id="@+id/row_2" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_margintop="20dp" android:gravity="center" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="state:" android:textsize="22sp" android:textcolor="@color/white"/> <spinner android:id="@+id/search_states" android:layout_width="180dp" android:layout_height="40dp" android:drawselectorontop="true" android:entries="@array/state_names" android:ems="10" android:layout_marginleft="50dp" > </spinner> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="miles:" android:textsize="22sp" android:adjustviewbounds="true" android:gravity="center_horizontal|center_vertical" android:layout_marginleft="20dp" android:textcolor="@color/white"/> <spinner android:id="@+id/select_miles" android:layout_width="180dp" android:layout_height="40dp" android:drawselectorontop="true" android:entries="@array/near_miles" android:ems="10" android:layout_marginleft="27dp" > </spinner> </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_margintop="20dp"> <button android:id="@+id/search_distributor" android:layout_width="100dp" android:layout_height="wrap_content" android:layout_gravity="center_vertical|center_horizontal" android:gravity="center" android:background="@color/white" android:text="search" android:textsize="22sp" /> <textview android:id="@+id/dist_head" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="distributors near you" android:textcolor="@color/white" android:layout_gravity="center" android:textstyle="bold" android:layout_margintop="10dp" android:textsize="25sp"/> </linearlayout> <listview android:id="@android:id/list" android:layout_width="match_parent" android:layout_height="wrap_content"> </listview> </linearlayout>
your layout not change when roatate device because of
android:configchanges="keyboardhidden|orientation"
when define android:configchanges="keyboardhidden|orientation" in androidmanifest file, means indicate android system don't change layout when phone rotated.
remove check again.
i hope helps...:)
Comments
Post a Comment