2015-02-06 50 views
2

我正在使用iOS YouTube幫助程序庫在表格視圖單元格內以串聯方式顯示視頻。只要YTPlayerView退出全屏模式,我的桌面視圖的內容偏移就會略微偏離。我懷疑它與隱藏狀態欄的YTPlayerView或者與偏移量有關的東西有關。有沒有人經歷過這個?我想嘗試在YTPlayerView退出全屏時手動設置內容偏移量,但是我很難理解如何觀察它。 ViewWillAppear在我的tableview控制器不會被調用,我試過的NSNotifications不起作用。在YTPlayerView上也沒有出現委託方法。觀察在線和全屏模式之間的更改

回答

4

這對我的作品

UIWindowDidBecomeVisibleNotification UIWindowDidBecomeHiddenNotification

在你的ViewController

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enteredFullScreen:) name:UIWindowDidBecomeVisibleNotification object:nil]; 
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(exitedFullScreen:) name:UIWindowDidBecomeHiddenNotification object:nil]; 

你試過嗎?

+0

謝謝,我設法讓這個工作使用這些通知,並手動重新設置tableview內容插圖。不喜歡關閉全屏視頻後細胞跳躍(看起來有點業餘),但我想它會做。 – user3719120 2015-02-06 18:18:13