MWPhotoBrowser into Tabbar Controller

懵懂的女人 提交于 2019-12-12 05:35:49

问题


I use MWPhotoBrowser to make an image Gallery. If i make a new controller(push) all work fine. Although i want to add MWPhotoBrowser into a custom ViewController which is into a TabBarController. I got this with these lines of code.

[self addChildViewController:browser];

[[self view] addSubview:[browser view]];

[browser didMoveToParentViewController:self];

The problem is that when i change the orientation(rotate the device) only a part of screen works. The rest seems to be dead.I suppose that my view keeps previous frame bounds but i don't know how to change this.

I tried setFrame to self.browser.view but it didn't work.

The strange is that if i change tab and come back to photos tab all again work properly.


回答1:


If anyone has the same issue in future this line solved my problem. Maybe it was my mistake that i had forgotten this.So i had to add this line to my viewDidLoad method.

self.view.autoresizingMask= UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;


来源:https://stackoverflow.com/questions/20966764/mwphotobrowser-into-tabbar-controller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!