小编Don*_* Ma的帖子

UITableViewCell在使用xcode6 beta6接口构建器的iOS7和iOS8模拟器中表现不同

请看下面3个表视图单元格在同一个应用程序中,单元格的高度在界面构建器中为54,边框是在代码中使用CAShapeLayer创建的,高度为44.由于我在项目开发期间从xcode5切换到xcode6,所以uitableviewcell的一部分在xcode5中创建,部分在xcode6中创建,并且有一些单元在xcode5中创建,后来在xcode6中更改.

此搜索.使用xcode5创建,所需的样式 uitableviewcell内置在xcode5界面构建器中

图像2.使用xcode6 beta6创建,在iOS8模拟器中显示,disclosure indicator放错地方,并且文本是offseted uitableviewcell内置xcode6 beta6,显示在iOS8模拟器中

图像3.使用xcode6 beta6的image2的相同单元格,但在iOS7.1设备中运行,disclosure indicator放错地方 uitableviewcell内置xcode6 beta6,显示在iOS7.1设备中

我比较了界面构建器中uitableviewcell的所有设置,并找到了NO差异.

我比较了xxx.storyboard的源文件,最后得到了不同的观点:

case1:'tableViewCell'标签,xcode5版本是:

<tableViewCell contentMode="scaleToFill" selectionStyle="none" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="xxCell" rowHeight="54" id="far-Kn-fRP" customClass="xxCell">
  <rect key="frame" x="0.0" y="119" width="320" height="54"/>
Run Code Online (Sandbox Code Playgroud)

case2:'tableViewCell'标签,xcode6 beta6版本在下面,注意,创建新的uitableviewcell时缺少<rect key ="frame"...>

<tableViewCell contentMode="scaleToFill" selectionStyle="none" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="xxxCell" rowHeight="54" id="eav-sl-Yrd" customClass="xxxCell">
Run Code Online (Sandbox Code Playgroud)

case3:image2和image3中的场景是在xcode5中创建的uitableviewcell ,默认高度为44,并在xcode6 beta6中修改,将高度更改为54,源为:

<tableViewCell contentMode="scaleToFill" selectionStyle="none" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="xxxCell" rowHeight="54" id="eav-sl-Yrd" customClass="xxxCell">
  <rect key="frame" x="0.0" y="119" width="320" height="44"/>
Run Code Online (Sandbox Code Playgroud)

作为结论,似乎xcode6 beta6不处理.storyboard文件中的<rect …

uitableview ios xcode6-beta6

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

标签 统计

ios ×1

uitableview ×1

xcode6-beta6 ×1