简体   繁体   中英

How to make a view with picker and toolbar stay at the bottom of iphone screen

I am using this code and its placing my view at the top of the viewing area instead of the bottom. Any idea what I am doing wrong? I am not creating the view in swift because I already have it created in IB with a toolbar and pickerview inside it.

let height = view.frame.size.height

yearView.frame = CGRect(x: 0, y: height - 250, width: self.view.frame.width, height: 250)

Even if I use the y coordinate and say 50 the view wont budge from the top. All I am trying to do is place this subview at the bottom of any sized phone's screen so they can select a value inside the view.

yearView.frame = CGRect(x: 0, y: height - 250, width: self.view.frame.width, height: 250)

尝试将其移出ViewDidLoad,每次取消隐藏时都需要定位该视图,否则它将不会显示。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM