What are the differences between LinearLayout, RelativeLayout, and AbsoluteLayout?

ezhil picture ezhil · Feb 5, 2011 · Viewed 232.2k times · Source

I am confused about the difference between LinearLayout, RelativeLayout, and AbsoluteLayout. Could someone please tell me the exact differences between them?

Answer

Ganapathy C picture Ganapathy C · Feb 5, 2011

LinearLayout means you can align views one by one (vertically/ horizontally).

RelativeLayout means based on relation of views from its parents and other views.

ConstraintLayout is similar to a RelativeLayout in that it uses relations to position and size widgets, but has additional flexibility and is easier to use in the Layout Editor.

WebView to load html, static or dynamic pages.

FrameLayout to load child one above another, like cards inside a frame, we can place one above another or anywhere inside the frame.

deprecated - AbsoluteLayout means you have to give exact position where the view should be.

For more information, please check this address https://developer.android.com/guide/topics/ui/declaring-layout#CommonLayouts