[iOS]技巧集锦:UICollectionView在旋转屏幕后Cell中的约束不起作用或自动布局失效
2015-04-17 12:49
1896 查看
这似乎是iOS的一个BUG(ref: stackoverflow的大神们讲的)
解决方案
在继承自UITableViewCell的子类中的init方法中加入如下设置:
self.contentView.frame = self.bounds;
self.contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
解决方案
在继承自UITableViewCell的子类中的init方法中加入如下设置:
self.contentView.frame = self.bounds;
self.contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
相关文章推荐
- iOS 开发,屏幕旋转、旋转屏幕collectionView cell 的自动布局问题
- iOSUITableView自动布局 ----动态cell
- iOS 8自动调整UITableView和UICollectionView布局
- iOS 8自动调整UITableView和UICollectionView布局
- iOS 判断 UITableViewCell 和 UICollectionViewCell 是否移出屏幕
- [iOS]技巧集锦:UICollectionView内容下沉64像素原因和解决方案
- [iOS]技巧集锦:UITableView自定义Cell中的控件无法完全对齐Cell的左边界和右边界
- [autoLayout]自动布局下的纯storyboard添加约束--四个imageView平分一个屏幕的宽度
- iOS 8自动调整UITableView和UICollectionView布局
- iOS自动布局实现Cell和Tableview高度自适应(SDAutoLayout)
- iOS 8自动调整UITableView和UICollectionView布局
- iOS 8自动调整UITableView和UICollectionView布局
- Cocoa Touch 入门记——《精通 iOS 开发》学习心得(2) [iOS 7(Xcode 5)中的屏幕旋转与自动布局]
- iOS系统自带的 **UIAlertView** 以及 屏幕自动旋转的实现
- IOS某个ViewController禁止自动旋转
- ios UICollectionViewCell个数小于等于3,顺序错位
- iOS 8 Auto Layout界面自动布局系列3-使用代码添加布局约束
- iOS开发技巧(系列十五:autolayout自动布局)
- iOS之流布局UICollectionView全系列教程
- IOS TableView的Cell高度自适应,UILabel自动换行适应 table里控件位置自适应