0
在我的故事板中,我在UIViewController中放置了一個視圖。 我添加必要的參數有:[AVPlayerLayer superview]:在Swift中發送到實例的無法識別的選擇器
,並與我的代碼連接它:
在代碼中,我有:
,並導致錯誤:
*** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[AVPlayerLayer superview]:
unrecognized selector sent to instance 0x7fe320cb2030'
你能告訴我是什麼原因導致了這個問題,它如何解決?
好,感謝的人,它的工作,我也不得不把一些約束編程:'playerLayer .frame = CGRect(x:0,y:0,width:self.view.frame.size.width,height:self.view.frame.size.height)',現在視頻位於屏幕的中心 - 我怎樣才能讓它從屏幕的最頂端開始? – user3766930
@ user3766930那些不是約束,你手動設置圖層的框架。如果您想要將播放器圖層更改爲屏幕中心,請將約束添加到故事板中的「yawpVideo」視圖。 – JAL