self.image.frame.width = 20 give get only property error

前端 未结 3 1015
灰色年华
灰色年华 2021-01-05 09:37

i tried to change the width of my Image view to 20 @IBOutlet weak var image: UIImageView! using this code in viewDidLoad self.image.frame.width = 20

3条回答
  •  既然无缘
    2021-01-05 10:19

    Swift:

    let widthValue = self.view.frame.size.width
    self.btnName.frame.size.width = widthValue
    self.txtEMail.frame.size.width = (widthValue - 32)
    self.lblUserName.frame.size.width = (widthValue * 2)
    

提交回复
热议问题