Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to AbsoluteLayout in Android?

Tags:

android

If AbsoluteLayout is deprecated what can I use instead of it?

I've done an app that uses AbsoluteLayout but it doesn't work well with the different screen resolutions. I use because I can set the X and Y position of a button. Can I set the position of a button using another layout?

like image 268
JoeyCK Avatar asked Aug 21 '10 22:08

JoeyCK


People also ask

Why is the AbsoluteLayout not recommended for use?

Absolute Layout:- This is not recommended for most UI development (in fact Absolute Layout is currently deprecated) since absolutely positioning every element on the screen makes an inflexible UI, that is much more difficult to maintain.

Is absolute layout deprecated?

Part of the reason AbsoluteLayout is deprecated is because it does not support multiple screen sizes well. Any direct corollary to AbsoluteLayout (e.g., FrameLayout with margins) will suffer the same problem.

What is relative layout in Android?

RelativeLayout is a view group that displays child views in relative positions. The position of each view can be specified as relative to sibling elements (such as to the left-of or below another view) or in positions relative to the parent RelativeLayout area (such as aligned to the bottom, left or center).

What is absolute layout in Java?

An Absolute Layout allows you to specify the exact location .


1 Answers

you can use RelativeLayouts as described here: Set the absolute position of a view

like image 198
Kyle Avatar answered Sep 21 '22 12:09

Kyle