문제

In Xcode 4, there was a never-quite-fixed bug where Xcode prevented you from resizing views (some silly "Design feature") - you had to make sure you set all the topbar/statusbar/navbar/tabbar to "none" before it would unlock the controls.

XCode 5 appears to have taken this bug ... and extended it!

Now it's completely impossible to edit the size of a UIView in a NIB/XIB file. Nothing I do makes a difference, the dimensions are always readonly. I really, really don't want to write source code (so that our NIB + Storyboards will now always look wrong) to workaround this bug, but I can't find any other way.

Anyone found a workaroind inside Xcode itself?

도움이 되었습니까?

해결책

In the Attributes inspector, in the Simulated Metrics section, change the size to None. This unlocks the view and you can drag to resize it.

EDIT: As noted in the comments below, in more recent versions of Xcode you must set the attribute to Freeform, not None.

다른 팁

There is the solution for XCode 9.0

Select your view and set simulated Metrics as this :

enter image description here

After this, you can edit your view's size :

enter image description here

DEPRECATED :

There is the solution for XCode 8.1

Select your view and set simulated Metrics as this :

enter image description here

After this, you can edit your view's size :

enter image description here

Such settings:
XIB settings

makes me possible to change view size:
XIB settings

Xcode version: 5.1 (5B130a)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top