2

我的 xml 文件有问题,我希望 background_bar 占据全屏宽度(在屏幕顶部),但我不能这样做。请帮助我这是我的代码

<?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="fill_parent"
    android:background="@drawable/background"
    android:orientation="vertical" >

 <RelativeLayout
   android:layout_width="fill_parent"
   android:layout_height="wrap_content" >

    <ImageView
        android:id="@+id/main_background_bar"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/background_bar"/>

    <ImageView
        android:id="@+id/main_logo_bar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_marginLeft="5dp"
        android:src="@drawable/logo_bar" />

    <ImageView
        android:id="@+id/main_title_bar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_marginLeft="27dp"
        android:layout_toRightOf="@+id/main_logo_bar"
        android:src="@drawable/notifme_title_bar" />

    </RelativeLayout>
</LinearLayout>
4

1 回答 1

0

尝试将android:scaleType="fitXY"其变体之一添加到 background_bar。

于 2012-04-22T20:39:49.753 回答