浏览代码

playlist: make sure that the mini playback controller doesn't hide parts of the data views

Felix Paul Kühne 10 年之前
父节点
当前提交
0707592a26
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      Sources/VLCPlaylistViewController.m

+ 11 - 0
Sources/VLCPlaylistViewController.m

@@ -150,6 +150,7 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
     }
 
     self.view = contentView;
+    [self displayMiniPlaybackViewIfNeeded];
 }
 
 #pragma mark -
@@ -445,9 +446,19 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
         _miniPlaybackView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
         [_miniPlaybackView setupForWork];
         [self.view addSubview:_miniPlaybackView];
+        CGRect listViewRect = viewRect;
+        listViewRect.size.height = listViewRect.size.height - _miniPlaybackView.frame.size.height;
+        if (_usingTableViewToShowData)
+            _tableView.frame = listViewRect;
+        else
+            _collectionView.frame = listViewRect;
     } else {
         [_miniPlaybackView removeFromSuperview];
         _miniPlaybackView = nil;
+        if (_usingTableViewToShowData)
+            _tableView.frame = self.view.frame;
+        else
+            _collectionView.frame = self.view.frame;
     }
 }