0
0
React Nativemobile~5 mins

Position (relative, absolute) in React Native - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does position: relative do in React Native?
It moves the element relative to its normal position without affecting other elements' layout.
Click to reveal answer
beginner
What is the effect of position: absolute in React Native?
It removes the element from the normal layout flow and positions it relative to its closest positioned ancestor.
Click to reveal answer
beginner
Which CSS properties are commonly used with position: absolute to place an element?
Top, right, bottom, and left are used to specify the exact position of the element.
Click to reveal answer
intermediate
If a parent has position: relative, how does it affect a child with position: absolute?
The child will be positioned relative to the parent, not the whole screen.
Click to reveal answer
beginner
Why might you use position: relative instead of position: absolute?
To shift an element slightly without removing it from the layout flow, keeping space reserved.
Click to reveal answer
What happens to an element with position: absolute in React Native?
AIt stays in the normal layout flow.
BIt moves relative to its normal position.
CIt becomes invisible.
DIt is removed from the layout flow and positioned relative to the nearest positioned ancestor.
Which property is NOT used to position an element with position: absolute?
Atop
Bleft
Cmargin
Dbottom
If no ancestor has a position set, where does an absolute element position itself?
ARelative to the screen or root container
BRelative to its parent with position: relative
CRelative to its sibling elements
DIt stays in the normal flow
What does position: relative NOT do?
ARemove the element from the layout flow
BReserve space in the layout
CShift the element from its normal spot
DAllow child absolute elements to position relative to it
Which is a good use case for position: absolute?
ATo slightly nudge text inside a button
BTo overlay a badge on an icon
CTo add margin between paragraphs
DTo center text inside a container
Explain how position: relative and position: absolute work together in React Native layout.
Think about how a child element can move inside a parent container.
You got /3 concepts.
    Describe a real-life example where you would use position: absolute in a mobile app UI.
    Imagine placing a small icon on top of a profile picture.
    You got /3 concepts.