Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Absolute layout vs Relativelayout in xamarin

I am very new guy for Xamarin environment..

Previously I am working in Android. Android have Relative layout & Absolute layout (Deprecated so not used)

I have knowledge of Relative layout in android.

But In Xamarin layouts are totally confused me.. more than 2 days I am confused with Relative layout vs Absolute layouts..

Anyone give me what is difference between about these layouts...

I don`t need brief explanation.. Please give me some points about these layouts.. Thanks

like image 981
Ranjithkumar Avatar asked Dec 25 '22 02:12

Ranjithkumar


1 Answers

  • RelativeLayout

    1. It is used to position and size views relative to properties of the layout or sibling views. Unlike AbsoluteLayout, RelativeLayout does not have the concept of the moving anchor and does not have facilities for positioning elements relative to the bottom or right edges of the layout. RelativeLayout does support positioning elements outside of its own bounds.

    2. Use RelativeLayout to create UIs that scale to fit any screen size.

    3. RelativeLayout can be used to position views on screen relative to the overall layout or two other views.

    4. Positioning and sizing a view within a RelativeLayout is done with constraints.

  • AbsoluteLayout

    1. It positions and sizes child elements proportional to its own size and position or by absolute values. Child views may be positioned and sized using proportional values or static values, and proportional and static values can be mixed.

    2. Use AbsoluteLayout to create pixel-perfect UIs.

    3. Because of the positioning model of AbsoluteLayout, the layout makes it relatively straightforward to position elements so that they are flush with any side of the layout, or centered. With proportional sizes and positions, elements in an AbsoluteLayout can scale automatically to any view size. For items where only the position but not the size should scale, absolute and proportional values can be mixed.

    4. AbsoluteLayout could be used anywhere elements need to be positioned within a view and is especially useful when aligning elements to edges.

    5. AbsoluteLayout, like RelativeLayout, is able to position elements so that they overlap.

like image 161
Rohit Vipin Mathews Avatar answered Jan 11 '23 01:01

Rohit Vipin Mathews