开发者

How to create a xib file with a smaller view?

开发者 https://www.devze.com 2023-03-03 16:16 出处:网络
Can I design a View smaller than the complete iPad screen size with UI Builder in xCode 4 ? If so, how ?

Can I design a View smaller than the complete iPad screen size with UI Builder in xCode 4 ? If so, how ?

I need to design a small View I'm going to use multiple times in the same main UIView. I w开发者_C百科ould like to design it with UI Builder, and then load it from xib.

But when I create a new xib file, the view size is always the iPad size.. thanks


In Xcode 5, change Size to Freeform, under Simulated Metrics in the Attributes Inspector


When you create a new view, simply select the "Empty" option, rather than the View option.

You can then drop a UIView on it - the difference being that you can re-size this view via the Size inspector (the little ruler icon) within the utilities pane. (The one on the left.)


Select view(UIView I must say) then go to Attributes inspector pane and change Size to Freeform by which we can adjust view size now.

0

精彩评论

暂无评论...
验证码 换一张
取 消