ios - pushViewController 仅在 iPad 上不起作用
问题描述
我有一个带有视图控制器成员的选项卡栏视图控制器,它嵌入在导航视图控制器中。在这个视图控制器中,我有一个带有项目列表的表格视图。当您单击一个项目时,您将被定向到另一个视图控制器。这是所选行的代码:
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print([indexPath.row])
let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let sleepViewController = storyBoard.instantiateViewController(withIdentifier: "SleepItemEnter") as! SleepEnterTimesViewController
sleepViewController.daySelected = sleepList[indexPath.row].dayOfWeek
sleepViewController.daySelectedInt = indexPath.row
self.navigationController?.pushViewController(sleepViewController, animated: true)
}
现在它在我测试的所有 iPhone 上都运行良好。但是现在我在 iPad Pro 上测试了一下,还是不行。“self.navigationController?.pushViewController”行不起作用。新的视图控制器根本没有显示。
为什么会这样,只在 iPad 上?
解决方案
推荐阅读
- python - 羊驼 api 股票数据 JSONDecodeError:预期值:第 1 行第 1 列(字符 0)
- java - 如何解决android(java)中的退格错误
- swift - 将 NULL、NaN 和非数字字符转换为 Double
- c - 带有 VLA 的结构
- php - 使用php向电报机器人发送消息的问题
- docker - 在同一个 docker 映像中运行 aws cli v1 和 v2
- php - 为什么需要在每个存储过程之前包含连接文件
- flutter - 如何使用文本字段中的位置动态过滤列表
- mysql - 在 Linux 中删除 MySQL BinLog
- .net - 从先前请求缓存的自定义 AuthorizeAttribute