I have Created A UIView.XIB
**And I want to Design it In such manner that it view like I want in Black Box
I don't know how to design Xib that It View Perfectly inside the box. I need 1 ImageView And 1 Label **
class GenderView: UIView {
@IBOutlet var viewContent: UIView!
@IBOutlet weak var imageGender: UIImageView!
@IBOutlet weak var labelGender: UILabel!
override init(frame: CGRect) {
super.init(frame: frame)
designview()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
designview()
}
func designview() {
Bundle.main.loadNibNamed("GenderView", owner: self, options: nil)
addSubview(viewContent)
viewContent.frame = self.bounds
viewContent.autoresizingMask = [.flexibleHeight,.flexibleWidth]
}
}
question from:
https://stackoverflow.com/questions/65931836/how-to-design-uiview-xib-and-view-same-in-viewcontroller 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…