开发者

Add sub views in Navigation Controller

开发者 https://www.devze.com 2022-12-12 09:36 出处:网络
I have a main view which has 3 labels positioned on the top. At the bottom there are about six buttons. On tapping each of the buttons, a different view is to displayed in the center area.

I have a main view which has 3 labels positioned on the top. At the bottom there are about six buttons. On tapping each of the buttons, a different view is to displayed in the center area.

Each of those views have a view controller of its own. In the viewdidload method I set the view frame's y position and height so that it fits in the center area.

This all works 开发者_运维技巧if I add those views as subviews. But I want to maintain a view hierarchy. So I tried to use navigation controller. But the problem is the main view goes off screen and the child view is positioned from the top.

How do I solve this problem?


Do you mean the navigation controller supports adding of subviews without taking off the parent view from the screen?

0

精彩评论

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

关注公众号