Reputation: 775
I have a splash screen on my android app, which is populated by a png image. However the png image is not populating the full screen, there are spaces showing on the sides.
I am viewing this on and AVD.
Here is what I see:
Here is my XML code:
<?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>
Here is an extract of my Android Manifest code:
<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>
Please can any one help? I have tried to increse the dimesions of the png itself but this makes no difference.
Upvotes: 0
Views: 312
Reputation: 15728
You need to add the android:scaleType
attribute to the ImageView
. Probably centerCrop
is what you want.
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="centerCrop"
android:src="@drawable/splash" />
Upvotes: 2