English 中文(简体)
UIMModal UIMModal UIMOdal 流体细胞移植问题
原标题:UIModalPresentationFullScreen rotation issues

我试图创建一个显示全屏幕图像并可以被浏览的视图, 这个视图正在被从另一类人调用到 UIModalPresentationFullScreen, 屏幕大小由 UIScreen mainScreen. imbounds 来决定。 我尝试了使用调用器视图, 但是在这种视图中, 那里有一个标签栏是不需要的。 从肖像开始, 它工作得很好, 但是当从景观中调用时, 它是空白的。 最后, 当旋转它到肖像时, 我们得到了这个宝石 :

"https://i.sstatic.net/nTdb5.png" alt="portrait图像问题"/ >

我不知道会是什么原因, 因为IB的所有观点 都设定到屏幕的大小 并坚持到两边。

这里的调用密码是:

 MyImageViewController *view = [[MyImageViewController alloc]initWithNibName:@"MyImageViewController"bundle:[NSBundle mainBundle]];
            view.modalPresentationStyle = UIModalPresentationFullScreen;
            view.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
            [self presentModalViewController:view animated:YES];
            view.view.superview.bounds = [[UIScreen mainScreen] bounds]; 
最佳回答

为了使模型视图成为完整的屏幕,同时又不引起这种观点,我最后做的是使用不同的演示风格,确保宽度和高度都具有灵活性。

[view.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth| 
     UIViewAutoresizingFlexibleHeight];
[view setModalPresentationStyle:UIModalPresentationCurrentContext];

现在,全屏的景象运作良好。

问题回答

暂无回答




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签