ios - 基于窗口的应用程序或基于导航的应用程序

标签 ios uitableview uiimageview

我正在开始开发一个新的 iPhone 应用程序,我将实现的界面包含很多这样的内容:

enter image description here

我实际上有两个问题,使用什么合适的模板?基于窗口或导航的应用程序? 第二个问题:在基于导航的应用程序中,运行应用程序时出现的第一个 View 是包含 UITableView 的 View ,如下所示,我可以将其替换为图像(UIImageView)吗?

enter image description here

最佳答案

是的,您正在寻找基于导航的应用程序。是的,您可以用 UIImageView 替换 UITableView。我倾向于使用基于窗口的项目来启动任何项目,这是使用基于窗口的项目的快速方法:

  • 创建一个基于窗口的项目
  • 创建第一个 View Controller
  • 然后在应用程序委托(delegate)的 applicationDidFinishLaunching 方法中,创建一个导航 Controller ,将其 Root View Controller 设置为您在上一步中创建的 View Controller ,并将 mac Controller 设置为该应用程序的 Root View Controller 。 window 。这是示例代码:

    FirstVC firstVC = [[FirstVC alloc] initWithNibName:@"FirstVC"包:@"nil"];

    UINavigationConroller *navVC = [[UINavigationController alloc] initWithRootViewController:firstVC];

    [[自身窗口] setRootViewController:firstVC];

如果您想使用基于导航的项目,则只需在 initWithRootViewController 中删除模板设置的 View Controller 并将其设置为您自己的 View Controller 即可。

关于ios - 基于窗口的应用程序或基于导航的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7386114/

相关文章:

ios - UIView不圆角,UITableView单元格回收

ios - 将 UILabel 剪辑到 UIImageView

swift - 使用 AVFoundation 捕获静态图像

ios - 取消归档带有 subview 的 UIImageView

ios - 检查是否在核心数据中设置了属性?

iphone - ios 推特 OATH 集成不起作用

ios - Xcode 9.3 无法查看实时设备日志

iphone - 设置 UITableViewCell 的动态高度,其中仅包含图像(可变高度)

ios - UISearchController 不会向上移动我的 UITableView

ios - 如何将一个 Storyboard中的导航 Controller 连接到另一个 Storyboard中的 View Controller ?