开发者

Adding a margin/padding between the navigationbar and the content in a uinavigationcontroller

开发者 https://www.devze.com 2023-03-29 21:35 出处:网络
I wan\'t to add some space between the navigationbar and the content of the navigationcontroller. So I would like to change the开发者_StackOverflow中文版 frame of the content. However, I have been una

I wan't to add some space between the navigationbar and the content of the navigationcontroller. So I would like to change the开发者_StackOverflow中文版 frame of the content. However, I have been unable to figure out how to do this. This should hopefully be a easy enough task, it's probably just me that don't know the right apis. Just to clarify, this is the effect I want:

+-----------+
|  TITLE    |
+-----------+
               <--- margin/padding that I should be able to set in code
+ - - - - - +
    SOME
|  TABLE-   |
    VIEW
|    OR     |
  WHATEVER
+ - - - - - +


I think the easiest way is to create custom view and set it as main to all view controllers inside nav controller. Override setFrame: method in custom view and adjust frame each time before passing it to superview.

0

精彩评论

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