使视图自动调整大小
在控制器
scrollView.autoresizesSubviews = YES;
的 viewDidLoad 中,我从 Nib 加载视图对象,
[scrollView addSubview:presentationController.view];
此时,scrollView 本身具有正确的调整大小(位于选项卡视图控制器内)。问题是新加载的视图对象的布局没有更新。
- 有什么办法可以让对象调整大小吗?
- 我还能在哪里拦截添加子视图后它已经自动调整大小的点,以便我可以在那里添加我的代码?
我需要的是该加载视图的一些额外的布局调整代码,但它应该具有正确的视图大小来应用调整。
in controller
scrollView.autoresizesSubviews = YES;
in viewDidLoad of controller I load view object from Nib and
[scrollView addSubview:presentationController.view];
At this point scrollView itself has correct adjusted sizes(which is within tab view controller). The problem is that the layout of newly loaded view object is not updated.
- Is there any way to make the object to resize?
- Where else I can intercept the point where after adding subview, it's already auto resized, so I can add my code there?
What I need is some additional layout adjustment code for that loaded view, but it should have correct view size to apply the tweaks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
看看是否有帮助?
Try
and see if that helps?