How to set height and width in proportion with superview in SwiftUI?
问题 I want to know that is it possible to adjust height and width in proportion according to superview in SwiftUI to any UIControl ? As we are doing like : let txtFld = UITextField() txtFld.frame = CGRect(origin: CGPoint(x: 0, y: 0), size: CGSize(width: self.view.frame.width/2, height: self.view.frame.height*0.1)) I know we can somehow achieve to adjust width by using Spacer() , .padding and edgeInsets . But what about height ? I have seen lots of tutorial for SwiftUI , everywhere height is