![](/img/trans.png)
[英]how to fit collection view cell in table view cell ( adaptive on all screen sizes?)
[英]how to Fit image view in the Screen in all iPhoneScreens
我已经使用约束以编程方式创建了图像视图
let imgName = "2017-01-18-2.png"
let image = UIImage(named: imgName)
let imgView = UIImageView(image: image!)
imgView.frame = CGRect(x: 0, y: 0, width: 365, height: 667)
view.addSubview(imgView)
但是,当我在iPhone 5s中运行它的全视图(全视图图像)如果我在iPhone 7中运行它即将升级(LilbitUp图像)我已经搜索了所有先前的问题,但所有人都说在故事板中创建约束但我想以编程方式做,如果有任何帮助,将不胜感激,谢谢你提前
试试这个
imgView.frame = CGRect(x: 0, y: 0, width: view.frame.width, height: view.frame.hight)
在Objective-c中
UIview.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.