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"またはそのバリエーションの 1 つを background_bar に追加してみてください。

于 2012-04-22T20:39:49.753 に答える