我的问题是,默认的iPhone菜单是使用情节提要创建的UIcollection视图,还是它的功能更多? (为了避免模仿其功能)

最佳答案

如果您想了解SpringBoard的视图层次结构:

  • 如果尚未运行iOS模拟器,请启动它。
  • 确保您正在模拟器中查看SpringBoard。
  • 在Xcode中,选择“产品”>“附加到过程”>“跳板”。跳板过程在列表的“系统”部分中进行了下去。
  • 仍在Xcode中,选择“产品”>“调试”>“暂停”。
  • 在Xcode的调试控制台(应该在其中显示(lldb)提示符)中,键入po [[UIApp keyWindow] recursiveDescription]

  • 瞧,您可以获得SpringBoard整个屏幕视图层次结构的打印输出。我的开始像这样:
    (lldb) po [[UIApp keyWindow] recursiveDescription]
    $0 = 0x0b63abf0 <SBAppWindow: 0xce3ef10; baseClass = UIWindow; frame = (0 0; 320 480); layer = <UIWindowLayer: 0xce3f010>>
       | <SBUIRootView: 0xb162de0; frame = (0 0; 320 480); layer = <CALayer: 0xb162e60>>
       |    | <UIView: 0xb163010; frame = (0 0; 320 480); autoresize = W+H; layer = <CALayer: 0xb1630c0>>
       |    |    | <SBWallpaperView: 0xb1632a0; baseClass = UIImageView; frame = (0 0; 320 480); userInteractionEnabled = NO; layer = <CALayer: 0xb160f70>>
       |    |    |    | <UIImageView: 0xb1610d0; frame = (0 0; 0 0); hidden = YES; userInteractionEnabled = NO; layer = <CALayer: 0xb161130>>
       |    |    |    | <UIImageView: 0xb161160; frame = (0 0; 0 0); hidden = YES; userInteractionEnabled = NO; layer = <CALayer: 0xb163390>>
       |    |    | <SBIconContentView: 0xb163da0; frame = (0 0; 320 480); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0xb163e50>>
       |    |    |    | <UIView: 0xc939710; frame = (0 371; 320 109); opaque = NO; autoresize = W+TM; layer = <CALayer: 0xc939770>>
       |    |    |    |    | <SBDockIconListView: 0xc9381d0; frame = (0 20; 320 89); autoresize = TM; layer = <CALayer: 0xc9382c0>>
    ...
    

    10-08 05:25