Can't resize UIView in IB

2019-01-30 00:25发布

Probably something simple, but I can't figure why I cannot resize a UIView in a xib in Interface Builder.

I created a new view XIB in xcode and in the size inspector, the width and height are disabled and grayed out to 320 by 460. This is strange since I can change the size for the other two views (associated with the other two tab bar items).

I am not sure if this has anything to do with but I recently updated the sdk to 3.

Thanks!

8条回答
Luminary・发光体
2楼-- · 2019-01-30 01:02

I sorted it out in a different way...

open your xib with your favourite text editor and edit this line

        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CompassViewController">

CompassViewController is your class name you are trying to link your nib/xib with.

Just edit your class name with the correct class name and you are done ;)

查看更多
闹够了就滚
3楼-- · 2019-01-30 01:04

As at Xcode 4.2, iOS 5.0.1, the default simulated metrics include simulating the 'size' attribute of UIViewControllers to 'Inferred'

If you change this attribute to 'Freeform' then you are able to resize the UIView contained within the UIViewController while also simulating the status bar (or any other of the simulations for that matter)

查看更多
登录 后发表回答