views:

97

answers:

2

I have to create a UI with components(TextView, Bottons etc) placed at particular coordinates as specified in an XML coming from a server. I am currently using AbsoluteLayout but since its deprecated i want to use some other method.

+1  A: 

Use FrameLayout, this way you can position x/y exact anywhere using the margin (i.e. marginTop, marginLeft) properties of the components.

http://developer.android.com/reference/android/widget/FrameLayout.html

Mathias Lin
+1  A: 

You can use the AbsoluteLayout. There you can set the exact coordinates of the UI element. However, I would no really recommend to use in any situation, because you can get in trouble with different screen size/resolution.

Roflcoptr
Its a server requirment. Server will send the coordinates itself as the UI is required to be fully dynamic
Funkyidol
also Absolute layout is deprecated so it's not recommended to use
Mina Samy