You can set action background after API 11.
ActionBar actionBar = getActionBar();
Drawable drawable = getResources().getDrawable(R.drawable.dummy_action_bar);
actionBar.setBackgroundDrawable(drawable);
This is an example of how you shouldn't do it!!! (see comments)
====================================================================
In AndroidManifest
, add to your activity theme attribute with no Action Bar:
android:theme="@android:style/Theme.Holo.Light.NoActionBar"
Add RelativeLayout
to your layout, with blue background and ImageView
containing logo on the right.
<RelativeLayout
android:id="@+id/fakeActionBar"
android:layout_width="fill_parent"
android:layout_height="48dp"
android:background="#F00A"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
>
<ImageView
android:layout_width="100dp"
android:layout_height="48dp"
android:layout_alignParentRight="true"
android:src="@drawable/logo_top"
/>
</RelativeLayout>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.