tags:

views:

169

answers:

3

Hi,

Accoding to emulator Resolution how to change the activity(Screen) controls size according to screen Resolution in android ?

i have screen design like below

it is working in HVGA(320x480) resolution progressbar is coming bottom of screen but if i run in other resolution emulator VM (WQVGA432 - 240x432) i am getting the progressbar middle of the screen .

i am not able to fix the in permenent(fixed) position

i am using below code in manifest file but no output

android:normalScreens="true" android:largeScreens="true"
android:anyDensity="true" />

i am not getting the solution so please give some idea for resolve the issue.

Regards, Jeyavel N

A: 

It depends on how you have defined your layout: posting your layout XML will help here.

Samuh
A: 

I would guess if its in the middle you have something like:

android:layout_gravity="center"

But yeah, posting your XML would be a bit help!

Laurence Dawson
A: 

If you want your layouts to work on different resolution screens your should be sizing them using dip as the unit. For example:

android:layout_marginRight="10dip"

dip stands for Device Independent Pixel and using these in your layout means that Android will automatically scale your layout depending on which display the device running your application has.

You can read about these in the Supporting Multiple Screens page in the Android Developer Documentation. This document also has some other options for handling different displays but I think using dip is probably the easiest.

Dave Webb