Reputation: 21
I am making splash screen which background have images.I put 480x800 size image in drawable hdpi similarly rest of mdpi(320x480),lpdi(240x320).
Problem is that when i test hdpi emulator or other emulator image is not fit
code is as-
<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:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ImageView>
</LinearLayout>
set into actvity simply..
Upvotes: 0
Views: 97
Reputation: 128428
use android:scaleType
attribute inside ImageView.
To know more about this property, go here => android:scaleType
Upvotes: 0
Reputation: 7295
Screens resolution is one thing but screen dimensions is something else. If you want to fill up full screen try using
android:scaleType = "fitXY"
in xml file. But this will stretch pic. If your pic is not scaling right try using draw9patch in android sdk tools folder.
If not, try to play with others scaleType methods.
Upvotes: 1
Reputation: 1427
try this code
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/ic_launcher">
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/ic_launcher" />
</LinearLayout>
Upvotes: 0