2

![現在のレイアウト] http://i50.tinypic.com/qqznzs.png

レイアウトの上下にあるblakcバーを黒ではなく白にしようとしています。すでに背景色を変えてみました。

描画可能なコード:

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:gravity="clip_horizontal|clip_vertical|center"
    android:src="@drawable/theblindgoat_logo"
    android:tileMode="disabled" >
</bitmap>

メインコード:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/startup"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#FFFFFF"
    android:orientation="vertical" >

ところで、私は画像が垂直に伸びないようにする必要があるので、それを変更することも必要な解決策ではありません。

4

3 に答える 3

2

これらの黒いバーは、テーマの背景の色にすぎません。それらを取り除くために、次のように、ビットマップドローアブルを背景色が白のレイヤーリストに変更できます。

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <item>
        <color android:color="@android:color/white"/>
    </item>

    <item>
        <bitmap android:gravity="clip_horizontal|clip_vertical|center"
            android:src="@drawable/theblindgoat_logo"
            android:tileMode="disabled" />
    </item>

</layer-list>
于 2012-09-11T15:15:16.613 に答える
1

あなたは2つの方法でその黒い色を捨てることができます:

  • 背景LinearLayoutを白色 に設定してからImageView、目的の画像ソースで内部を追加します

または

  • AndroidManifest.xmlandroid:theme="@android:style/Theme.Light.NoTitleBar"でアクティビティに 設定し、残りはそのままにします
于 2012-09-11T14:40:05.920 に答える
0

LinearLayoutの背景をビットマップに設定してみてください。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/startup"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/theblindgoat_logo"
    android:orientation="vertical" >

これにより、画像が引き伸ばされて背景が塗りつぶされます。

于 2012-09-11T14:48:02.230 に答える