Adding UITextField on UIView Programmatically Swift

前端 未结 9 1287
不知归路
不知归路 2021-01-30 06:42

I\'m new to Swift and iOS programming. I was trying to create a UITextField programmatically using Swift but couldn\'t get it quite right. Also how do you change it

9条回答
  •  心在旅途
    2021-01-30 07:22

    Add the textField on UIView is

    var textField=UITextField(frame:CGRectMake(x,y,width,height));
    self.view.addSubView(textField)
    

提交回复
热议问题