【问题标题】:CollectionView and rotation problemsCollectionView 和旋转问题
【发布时间】:2014-02-16 22:24:17
【问题描述】:

我有一个在UICollectionView 上弹出的模态表单视图。在该模态视图中,我将MPMoviePlayerController 嵌入到UIWebView 中。如果您让电影播放器​​全屏显示然后旋转它,则 CollectionView 不会随之旋转。看,当我在视频不是全屏时旋转视图时,我可以看到 CollectionView 更新了视图后面的单元格定位。但是,在播放视频时它不会这样做。知道如何解决这个问题吗?

【问题讨论】:

  • MPMoviePlayerController 嵌入到UIWebView?向我们展示该代码。
  • 在 ViewDidLoad: NSURL *url = [NSURL URLWithString: self.videoURL]; _moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url]; [[_moviePlayer view] setFrame:[webView bounds]]; [webView addSubview:[_moviePlayer view]]; [_moviePlayer 播放];

标签: uiwebview uicollectionview mpmovieplayercontroller


【解决方案1】:

在 ViewDidLoad 中:

NSURL *url = [NSURL URLWithString: self.videoURL];           
_moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url]; 
[[_moviePlayer view] setFrame:[webView bounds]]; 
[webView addSubview:[_moviePlayer view]]; [_moviePlayer play];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-20
    • 2011-04-10
    相关资源
    最近更新 更多