我需要在自定义窗口标题栏中添加3个图像。第一张图片的gravity
是left
。第二张图像的gravity
为第三张图像的center
和gravity
为right
。我使用了下面的代码。但不显示第三张图片。我认为它被第二张图片覆盖。将图像添加到Android中的自定义窗口标题栏
如何在上述位置显示3张图像?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="35dip"
android:background="#323331"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="5dip" >
<ImageView
android:id="@+id/header_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/header_img_dec"
android:src="@drawable/left_logo" />
<ImageView
android:id="@+id/header_middle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/header_img_dec"
android:gravity="center" />
<ImageView
android:id="@+id/header_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:contentDescription="@string/header_img_dec"
android:src="@drawable/right_img" />
</LinearLayout>