[英]play multiple videos in xcode swift
Yes, you can use buttons in a tab bar, but that is not a great tab-bar experience. 是的,您可以在选项卡栏中使用按钮,但这并不是很好的选项卡体验。 Nevertheless... a simple design would have
不过...一个简单的设计应该有
ViewControllers 0 - n ViewControllers 0-n
for every controller from 0 - n, a tab on the bar. 对于从0-n的每个控制器,在栏上有一个选项卡。
Every controller subclasses a BaseVideoViewController that takes a parameter of a video url (local or network) and plays it on viewdidappear/viewwillappear, and hides it on viewdiddissapear. 每个控制器都将一个BaseVideoViewController子类化,该BaseVideoViewController带有视频URL(本地或网络)的参数,并在viewdidappear / viewwillappear上播放它,并在viewdiddissapear上隐藏它。
If you want to have it work without specific viewcontrollers, create a delegate for your UITabBar 如果您希望它在没有特定的视图控制器的情况下工作,请为您的UITabBar创建一个委托。
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITabBarDelegate_Protocol/ https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITabBarDelegate_Protocol/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.