Android action bar custom layout not fit with screen -
hi using custom action bar layout in project.now have problem custom layout not fit full screen , action bar layout alignment changes on searchview click. custom layout
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <linearlayout android:layout_width="fill_parent" android:layout_height="40dp" android:background="#585858"> <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:orientation="vertical" android:layout_weight="0.5" android:gravity="center" > <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_launcher" android:scaletype="centerinside"/> </linearlayout> <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:orientation="vertical" android:layout_weight="1" android:gravity="center" > <searchview android:id="@+id/searchview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" > </searchview> </linearlayout> </linearlayout> </linearlayout>
how can solve problem?? please me :)
try this
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <linearlayout android:layout_width="fill_parent" android:layout_height="40dp" android:background="#585858"> <linearlayout android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="vertical" android:gravity="center" > <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_launcher" android:scaletype="centerinside"/> </linearlayout> <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:orientation="vertical" android:layout_weight="1" android:gravity="center" > <searchview android:id="@+id/searchview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" > </searchview> </linearlayout> </linearlayout>
Comments
Post a Comment