Tuesday, 2 December 2014

how to properly customiz the action bar in android



I have a problem with customazing the actionbar in android that in the designer of eclipse i have the design looks like that enter image description here


well this is what i want


but when i run the app i got this


enter image description here


the code of the actionbar is



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
android:id="@+id/Cover"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FF9800"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingBottom="8dp"
android:paddingTop="8dp" >

<ImageView
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_gravity="center"
android:layout_margin="5dp"
android:clickable="true"
android:src="@drawable/ic_menu_white_36dp" />

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="right|center_vertical"
android:orientation="horizontal" >

<ImageView
android:id="@+id/coverhidden"
android:layout_width="36dp"
android:layout_height="36dp"
android:visibility="gone" />

<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:layout_weight="1"
android:background="@drawable/profil_infos_rect"
android:drawableLeft="@drawable/ic_search_white_24dp"
android:hint=" Search"
android:padding="4dp"
android:textColor="#fff"
android:textColorHint="#FFFFFF"
android:textSize="18sp"
android:textStyle="bold" />

<ImageView
android:id="@+id/iconmsg"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:clickable="true"
android:src="@drawable/ic_msg" />
</LinearLayout>

</LinearLayout>

No comments:

Post a Comment