-1

Well I am using these setting for the android emulator

resolution - 480x800

Abstracted LCD density - 320

Max VM application heap size - 48

Device ram size - 512

and my images size is exactly the same as of android emulator resolution that is 480x800 but images do not fit horizontally on the emulator and it seems that image is short in width and result is

http://cubixshade.com/images/img.jpg

http://cubixshade.com/images/img2.jpg

I do not want to use android:background at ImageView, there is no need for stretching the image width or height when resolutions are kept same as the simulator resolution.

Muhammad Irfan
  • 1,447
  • 4
  • 26
  • 56
  • 1
    @muhammed irfam well obviously, unless you set the screen to android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" it won't be the size you specified. Also that's not how you should design layouts. – Hades Jul 26 '12 at 04:48
  • thanks hades, you are right. I got your point and I was looking for it. – Muhammad Irfan Jul 26 '12 at 06:28
  • 1
    @MuhammadIrfan show us the xml layout... – Hades Jul 26 '12 at 06:28

1 Answers1

0

You aren't taking into account the status bar or based on what I can tell in the image, the action bar. Both of these will reduce your vertical pixel size. Please realize that as Android has many device sizes so you'll have to take into account devices with many different screen sizes such as 320x480, 480x800, 480x854, 540x960, and so on. Your best bet is to take the elements in your image and make them appropriate Android UI element widgets so that you can handle multiple resolutions.

Morrison Chang
  • 11,691
  • 3
  • 41
  • 77
  • you are right I will take out elements in my image later but as you said the action bar and status bar are reducing vertical pixel size, my problem is why does the image not completely fill horizontal width. why there is space from both ends horizontally ? here is another sample http://cubixshade.com/images/img2.jpg – Muhammad Irfan Jul 26 '12 at 06:20