How do I change UIView Size?

前端 未结 8 1972
抹茶落季
抹茶落季 2020-12-07 23:48

I have trouble with modifying my UIView height at launch.

I have to UIView and I want one to be screen size * 70 and the other to fill the gap.

here is what

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-08 00:25

    For a progress bar kind of thing, in Swift 4

    I follow these steps:

    1. I create a UIView outlet : @IBOutlet var progressBar: UIView!
    2. Then a property to increase its width value after a user action var progressBarWidth: Int = your value
    3. Then for the increase/decrease of the progress progressBar.frame.size.width = CGFloat(progressBarWidth)
    4. And finally in the IBACtion method I add progressBarWidth += your value for auto increase the width every time user touches a button.

提交回复
热议问题