Android Relative Layout tutorial with Example
Android RelativeLayout is a view group that displays child views in relative to each other 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 Relative layout area (such as aligned to the bottom, left or center). Linear layout

- A
RelativeLayout is a very powerful utility for designing a user interface because it can eliminate nested view groups and keep your layout hierarchy flat, which improves performance.
RelativeLayout Attributes
| Number | Attribute |
|---|
| 1 | android:gravity Specifies how an object should position its content, on both the X and Y axes, within its own bounds. |
| 2 | android:ignoreGravity Indicates what view should not be affected by gravity. |
Inherited XML attributes |
|---|
From class android.view.ViewGroup android:addStatesFromChildren | Sets whether this ViewGroup’s drawable states also include its children’s drawable states. | android:alwaysDrawnWithCache | Defines whether the ViewGroup should always draw its children using their drawing cache or not. | android:animateLayoutChanges | Defines whether changes in layout (caused by adding and removing items) should cause a LayoutTransition to run. | android:animationCache | Defines whether layout animations should create a drawing cache for their children. | android:clipChildren | Defines whether a child is limited to draw inside of its bounds or not. | android:clipToPadding | Defines whether the ViewGroup will clip its children and resize (but not clip) any EdgeEffect to its padding, if padding is not zero. | android:descendantFocusability | Defines the relationship between the ViewGroup and its descendants when looking for a View to take focus. | android:layoutAnimation | Defines the layout animation to use the first time the ViewGroup is laid out. | android:layoutMode | Defines the layout mode of this ViewGroup. | android:persistentDrawingCache | Defines the persistence of the drawing cache. | android:splitMotionEvents | Sets whether this ViewGroup should split MotionEvents to separate child views during touch event dispatch. |
|
0 Comments