London Escorts sunderland escorts 1v1.lol unblocked yohoho 76 https://www.symbaloo.com/mix/yohoho?lang=EN yohoho https://www.symbaloo.com/mix/agariounblockedpvp https://yohoho-io.app/ https://www.symbaloo.com/mix/agariounblockedschool1?lang=EN
12 C
New York
Tuesday, November 26, 2024

ios – SwiftUI view centring behaviour on utilizing new body modifier


I’ve the next SwiftUI code:

    Rectangle()
        .fill(Coloration.blue.opacity(0.5))
        .body(width: 130)
        .body(maxWidth: .infinity)
        .background(Coloration.orange.opacity(0.5))
        .padding()
        .body(maxHeight:100)

Right here is the output.

enter image description here

Clearly it may be seen that the inside rectangle in blue has been positioned within the centre of outer rectangle. I attempted experimenting with the alignment of frames and may see alignment of inside rectangle can solely be modified by altering body alignment of outer rect as follows:

  .body(maxWidth: .infinity, alignment: .trailing)

However nothing adjustments if I alter body alignment property of inside rectangle.

I wish to perceive this behaviour extra clearly — whether or not view is centred by default, and why inside body alignment modification adjustments nothing.

Related Articles

Social Media Auto Publish Powered By : XYZScripts.com