我需要在自定義窗口標題欄中添加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>