Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
238 views
in Technique[技术] by (71.8m points)

ios - How to design UIVIew.XIB and view same in ViewController

Storyboard

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...