0

ICS に表示される画像 ここに画像の説明を入力

Gingerbread で実行する場合 ここに画像の説明を入力

フラグメントの XML コード

<?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:orientation="vertical"
 android:background="@drawable/background"
 android:id="@+id/homelayout" >

<ImageView
    android:id="@+id/homepageLogo"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:src="@drawable/background"
    android:alpha="255"
    android:scaleType="fitXY" />

</LinearLayout>

そのような奇妙な行動の理由は何ですか?

4

2 に答える 2

0

変更してみてください

android:layout_width="match_parent"
android:layout_height="match_parent"

android:layout_width="wrap_content"
android:layout_height="wrap_content"

あなたのImageViewで。XML をどのように使用しているかはわかりませんが、見た目からすると、LinearLayout の同じパラメーターを「wrap_content」に変更することもできます。これで、ImageView に (おそらく) 領域全体を埋めるように指示しています。

// アレックス

于 2012-12-19T07:35:36.323 に答える
0

この問題は、コードからアクションバーを動的に要求した場合にのみ発生します。

getWindow().requestFeature(Window.FEATURE_ACTION_BAR);

スタイルを使用して行う場合、この問題は見られません。

于 2012-12-19T09:00:18.517 に答える