简体   繁体   English

如何仅使用swift在iPhone中横向显示拆分视图

[英]how to show split view in landscape only in IPhone using swift

i have video player on the top and there is tableview below the video player. 我在顶部有视频播放器,在视频播放器下面有tableview。 video player has some custom control UI and below in the table view there are some cardview shows video list. 视频播放器具有一些自定义控件UI,并且在表格视图下面有一些cardview显示视频列表。 but when the video playback will end then in portrait its showing video view on top and bottom will show tableview. 但是当视频播放结束时,将以纵向显示,其在顶部和底部显示的视频视图将显示桌面视图。 in landscape i want to show two view. 在景观中,我想显示两个视图。 left side will show video end playback UI and right side will show the tableview . 左侧将显示视频结束播放UI,右侧将显示tableview。

i want to show like this 我想这样显示

If you are using Xcode 8.2 and swift3, in the Main.storyboard you have the option where you can see your application with the different Orientation and Device. 如果您使用的是Xcode 8.2和swift3,则在Main.storyboard中,可以选择使用不同的Orientation和Device查看应用程序。 You can adapt the view with the orientation that you choose. 您可以按照您选择的方向调整视图。 Like below: 如下所示:

在此处输入图片说明

Here a great tutorial about Auto Layout with Xcode8. 是有关使用Xcode8自动布局的出色教程。

Hope that helps, 希望能有所帮助,

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在swift中从iPhone的肖像底部呈现仅景观ViewController? - How to present a landscape only ViewController from portrait bottom of iPhone in swift? 在通用应用程序中为 iPhone 的 Split View Controller 禁用横向 - Disable Landscape for Split View Controller for iPhone in Universal App Swift - 如何只在星期一显示视图并且只显示一次 - Swift - How to only show view on a Monday and only show it once iPhone处于风景中时如何调用另一个视图 - How to invoke another view when the iPhone is on landscape iPhone iOS 6 UITabBarController仅限于纵向,如何使Modal View Controller支持横向方向 - iPhone iOS 6 UITabBarController Portrait Only, How to have Modal View Controller support Landscape Orientation 强制UISplitViewController始终以横向显示主(仅限)(在iPhone 6 Plus上) - Force UISplitViewController to always show master (only) in landscape (on iPhone 6 Plus) 故事板和iPhone 6仅限景观 - Storyboard and iPhone 6 landscape only SwiftUI:仅在 iPhone 上显示纵向视图,但在 iPad 上显示纵向和横向 - SwiftUI: Make View portrait only on the iPhone, but both portrait and landscape on the iPad 如果应用程序设备的方向是纵向的,那么如何仅在iOS中为一个视图构建者设置强制横向,Swift 2.3 - if app device orientation is portrait how to set force landscape only for one view constroller in ios, swift 2.3 如何在横向模式下显示一个视图控制器? - How to show one view controller in landscape mode?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM