0
0
Android Kotlinmobile~5 mins

Arrangement and alignment in Android Kotlin - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of LinearLayout in Android?

LinearLayout arranges its child views in a single row or column, either horizontally or vertically.

Click to reveal answer
intermediate
How does gravity differ from layout_gravity in Android layouts?

gravity controls the alignment of content inside a view.<br>layout_gravity controls how the view itself is positioned inside its parent.

Click to reveal answer
beginner
What does match_parent do when used for width or height?

It makes the view expand to fill the size of its parent container in that dimension.

Click to reveal answer
intermediate
Explain the role of weight in a LinearLayout.

weight lets child views share available space proportionally in a LinearLayout.

Click to reveal answer
advanced
What is the difference between RelativeLayout and ConstraintLayout?

RelativeLayout positions views relative to siblings or parent edges.<br>ConstraintLayout is more flexible and efficient, allowing complex positioning with constraints.

Click to reveal answer
Which layout arranges child views in a single column or row?
AFrameLayout
BLinearLayout
CConstraintLayout
DRelativeLayout
What does layout_gravity="center" do?
ACenters the content inside the view
BAligns the view to the top
CCenters the view inside its parent
DMakes the view fill the parent
If a child view has layout_weight="1" in a horizontal LinearLayout, what happens?
AIt shares extra space equally with other weighted views
BIt overlaps other views
CIt shrinks to minimum size
DIt gets no extra space
Which attribute aligns content inside a TextView?
Agravity
Bpadding
Clayout_gravity
Dmargin
Which layout is best for complex view positioning with flexible constraints?
AFrameLayout
BRelativeLayout
CLinearLayout
DConstraintLayout
Describe how you would center a button inside a parent layout using Android XML attributes.
Think about how to position the button itself and its content.
You got /4 concepts.
    Explain how weight works in a LinearLayout and why it is useful.
    Imagine sharing leftover space among views.
    You got /4 concepts.