小编Uza*_*aak的帖子

在iOS 8/Xcode 6 GM Seed上使用autolayout大小时,UIScrollView会中断

如何使用自动布局来计算其内容大小?

每当Scroll视图(带有Autolayout)存在时,Xcode 6似乎会创建一个"UIView Encapsulated Layout Height"约束,并且此约束将强制将高度设置为帧高度(从而使滚动视图的滚动功能无效).

布局破碎 -  Xcode 6 GM Seed中的iPhone 5s模拟器

错误:

2014-09-09 21:06:01.059 ScrollViewLayoutBreaking[24488:88731] Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
( …
Run Code Online (Sandbox Code Playgroud)

objective-c uiscrollview autolayout xcode6 ios8

7
推荐指数
1
解决办法
1767
查看次数

UICollectionViewCell使用原型大小

我有一个带有三个不同原型单元的UICollectionView,每个原型单元通过Storyboard设置不同的高度.在运行时,Collection View使用自己的单元格大小,忽略我的Storyboard.

我目前正在使用collectionView:layout:sizeForItemAtIndexPath:使用几个条件来直接设置每个CGSize.

有没有更好的方法来设置单元格大小?我似乎无法检索每个单元格的Storyboard大小,而CGSizeMake似乎太硬编码而且不够灵活.

objective-c ios uicollectionview uicollectionviewcell

6
推荐指数
1
解决办法
2696
查看次数