Bird
0
0

What spacing will be between the Text views in this VStack? VStack(spacing: 30) { Text("A") Text("B") Text("C") }

medium📝 Predict Output Q5 of 15
iOS Swift - SwiftUI Layout
What spacing will be between the Text views in this VStack? VStack(spacing: 30) { Text("A") Text("B") Text("C") }
A10 points
B30 points
CDefault spacing
D20 points
Step-by-Step Solution
Solution:
  1. Step 1: Understand VStack spacing parameter

    spacing sets the vertical space between child views inside VStack.
  2. Step 2: Identify the spacing value used

    spacing: 30 means 30 points vertical space between each Text view.
  3. Final Answer:

    30 points -> Option B
  4. Quick Check:

    VStack spacing parameter sets vertical gap [OK]
Quick Trick: VStack(spacing: value) sets vertical space between children [OK]
Common Mistakes:
  • Assuming default spacing when specified
  • Confusing spacing with padding
  • Using spacing for horizontal gaps

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More iOS Swift Quizzes