开发者

Automatically resize NSTabView to fit content view

I have a NSTabView with a number of NSView items. I want to resize the tab view so that the displayed view always fits snugly within the tab view.

I've tried a number of variations of setF开发者_如何转开发rame within the tabView's delegate didSelectTabViewItem and shouldSelectTabViewItem but can't seem to get it to work. I think I have to change the size of the tabView's contentRect, but this seems to be readonly.

Can anyone please give me a quick pointer to perhaps where this has been done before (I'm having no luck with Google).

Thanks,

John


Ok I finally got it:

  1. In Xcode (.xib editor), check the Resize box

    Automatically resize NSTabView to fit content view

    of the container window

    Automatically resize NSTabView to fit content view

  2. Click on the "tabView" and check this

    Automatically resize NSTabView to fit content view

    here

    Automatically resize NSTabView to fit content view

  3. At last simply adapt its resizing rules in the Size Inspector, that is!

    Automatically resize NSTabView to fit content view

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜