[英]PNG image not scaling to full screen size
我的Android應用程序上有一個啟動畫面,它由png圖像填充。 然而,png圖像沒有填充整個屏幕,側面顯示空格。
我正在觀看和AVD。
這是我看到的:
這是我的XML代碼:
<?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">
<ImageView
android:src="@drawable/splash"
android:layout_width="fill_parent"
android:layout_height="fill_parent"></ImageView>
</LinearLayout>
這是我的Android Manifest代碼的摘錄:
<uses-sdk
android:minSdkVersion="5"
android:targetSdkVersion="17" />
<supports-screens
android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.shaadcorp.wazaifapp.MainMenu"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="ButtonMenu"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.shaadcorp.wazaifapp.CLEARSCREEN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="wazeefa"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.shaadcorp.wazaifapp.WAZEEFA" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="durood"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.shaadcorp.wazaifapp.DUROOD" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
請任何人幫忙嗎? 我試圖增加png本身的角度,但這沒有任何區別。
您需要將android:scaleType
屬性添加到ImageView
。 可能是centerCrop
就是你想要的。
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="centerCrop"
android:src="@drawable/splash" />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.