Interface Builder不断重置自定义UITableViewCell的宽度 [英] Interface Builder keeps resetting the width of my custom UITableViewCell

查看:84
本文介绍了Interface Builder不断重置自定义UITableViewCell的宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Interface Builder为iPad应用程序设计自定义UITableViewCell

I'm using Interface Builder to design a custom UITableViewCell for an iPad application.

我有一个专用的XIB文件,其中包含UITableViewCell作为其根视图。我能够将UITableViewCell的宽度更改为1024(在XCode右侧属性窗格的大小检查器中),并且此操作会暂时调整画布上的单元格大小。

I have a dedicated XIB file which has a UITableViewCell as its root view. I am able to change the width of the UITableViewCell to 1024 (in the Size inspector on the right properties pane of XCode) and this DOES resize the cell on the canvas temporarily.

但是如果之后我尝试移动/调整UITableViewCell中的某些项目或关闭并重新打开XIB,XCode决定将UITableViewCell的宽度重置为320(特定于iPhone)宽度)。

However if afterwards I try to move/resize certain items within the UITableViewCell or close and reopen the XIB, XCode decides to reset the UITableViewCell's width back to 320 (the iPhone specific width).

然后画布上的单元格会遮挡单元格中的项目,并且除非我再次调整单元格大小,否则无法设计单元格。一旦你绕过这个循环几次就会变得相当烦人。

The cell on the canvas then obscures the items within the cell and makes designing the cell impossible unless I resize the cell again. Once you've gone round this loop a few times it gets rather annoying.

任何人都知道如何设置宽度以使其永久或者如何指定UITableViewCell是否特定于iPad?

Anyone know how I might set the width so its permanent or some how specify that the UITableViewCell is iPad specific?

要重新创建......

To recreate...


  • 文件>新建>文件...

  • UserInterface> Empty

  • 设备系列== iPad

  • File > New > File...
  • UserInterface > Empty
  • Device Family == iPad

拖动一个新的UITableViewCell到画布上(尽管先前选择了iPad,但创建宽度为320)

Drag a new UITableViewCell onto the canvas (its created with a width of 320 despite selecting iPad previously)

编辑:

我刚收到苹果公司对我很久以前创建的雷达车票的以下回应......

I have just received the following response from Apple to the Radar ticket I created ages ago...

Hello Oliver,

Hello Oliver,


这是关于Bug ID#13222753的后续行动。

This is a follow-up regarding regarding Bug ID# 13222753.

Engineering已请求以下信息为了
进一步调查此问题:

Engineering has requested the following information in order to further investigate this issue:

我们认为此问题已在最新的Xcode 5.1 Seed中得到解决。

We believe this issue has been addressed in the latest Xcode 5.1 Seed.

这是适用于Mac,X $ b iPhone和iPad的Xcode开发者工具集的预发布版本。它包括Xcode IDE,iOS模拟器,以及用于构建OS X和iOS应用程序的所有
所需的工具和框架。请使用此版本进行
测试,并使用结果更新您的错误报告。

This is a pre-release version of the Xcode developer toolset for Mac, iPhone, and iPad. It includes the Xcode IDE, iOS Simulator, and all required tools and frameworks for building OS X and iOS apps. Please test with this release, and update your bug report with the results.

Xcode 5.1 Seed - Build 5B71f发布日期:2013年12月13日

Xcode 5.1 Seed - Build 5B71f Posted Date: Dec 13, 2013

我还试图在Xcode 5.0.2中重新创建问题,看起来它也是用该版本修复的。

I've also just tried to recreate the problem in Xcode 5.0.2 and it looks like its fixed with that build also.

推荐答案

我不知道你是否认为这是一个有效的答案,但问题似乎只发生在我身上在IB中使用自动布局。如果我关闭它,Xcode调整UITableViewCell大小的问题就消失了。

I don't know if you consider this a valid answer, but the problem only seemed to occur for me when I was using autolayout in IB. If I turn that off, the problem of Xcode resizing the UITableViewCell goes away.

要关闭自动布局,只需选择UITableViewCell,然后在文件检查器的右侧,有一个 autolayout 将其关闭。

To turn off autolayout, just select the UITableViewCell and then on the right in the 'File inspector', there is a checkbox for autolayout to turn it off.

这篇关于Interface Builder不断重置自定义UITableViewCell的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆