autolayout之后获取uiview的frame
2015-09-23 15:03
423 查看
转载自:http://www.nikest.com/web/jswd/2015/0225/122190.html
这个只要一行代码就搞定了。详细请看:
就一行代码啊!
或者在这个方法中获取frame:
这个只要一行代码就搞定了。详细请看:
In order to get the right frame/bounds of your UIImageView after resizing, you need first ask auto-layout to update that layout using[yourImageView layoutIfNeeded]. that will solve your constraints and update youryourImage.bounds. [myImageView layoutIfNeeded]; NSLog(@"w: %f, h: %f", myImageView.bounds.size.width, myImageView.bounds.size.height); |
或者在这个方法中获取frame:
- (void)viewDidLayoutSubviews { // VC just laid off its views }
相关文章推荐
- easyui datagrid shift 多选
- UITextField通过UIPickerView显示选择内容
- UIImageView的属性之animationImages详解
- UIKit框架的介绍
- iOS学习之UISwitch控件两种使用方法和监听
- UIAlertView使用全解
- Android布局属性android:clipToPadding的UI设计妙用
- 可以自定义截屏大小的截屏功能
- easyUI中使用datatimebox选定开始日期时间后自动带出7天之后的结束日期时间
- UI中TExtField的几种回收键盘的方法
- UISegmentedControl的所有操作总结
- Iphone开发之UIView中的动画属性
- KVC中setValuesForKeysWithDictionary:详解
- java的String类StringBuffer类StringBuilder类
- UITabBarController使用详解
- ios开发——长按按出两个UIAlertView的解决办法
- Axure-产品交互设计师的利器
- 将原生的Launcher修改成类似MiUI的Launcher
- 算法练习:Sequence II
- Great StackOverflow questions