Thursday, September 11, 2025
HomeiOS Developmentios - place of picture in a stack minimize after being re-positioned

ios – place of picture in a stack minimize after being re-positioned


The picture is being clipped since you utilized .clipShape on the VStack. As its identify suggests, clipShape clips the contents of the view.

You need to use background(_:in:) to use a background to solely a selected area of the view, as decided by a Form.

VStack() {
    Picture("my_image")
        .resizable()
        .body(width: 100, peak: 100)
        .clipShape(RoundedRectangle(cornerRadius: 25.0))
        .padding(12)
        .offset(y: -50.0)
}
.body(maxWidth: .infinity)
// right here!
.background(.orange.opacity(0.25), in: RoundedRectangle(cornerRadius: 25.0))
.padding(.horizontal, 24)
.padding(.prime, 50)

enter image description here

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments