gpt4 book ai didi

ios - 操作表 IOS 中的分段控制

转载 作者:行者123 更新时间:2023-12-01 17:50:54 25 4
gpt4 key购买 nike

我正在尝试以与苹果 map 应用程序相同的方式在操作表中添加分段控件。 enter image description here

我找到了一种在操作 TableView 中添加为 subview 的方法,但苹果不建议这样做。我在某处发现了以下评论。

You might want to be careful with this. Apple may not like it. From the documentation: "UIActionSheet is not designed to be subclassed, nor should you add views to its hierarchy. If you need to present a sheet with more customization than provided by the UIActionSheet API, you can create your own and present it modally with presentViewController:animated:completion:." – Eric Goldberg Mar 4 '14 at 2:28



谁能建议我实现这一目标的方法。

最佳答案

多年来,我也一直试图弄清楚这一点。线索在左下角——线条并没有一直延伸到左边缘。它实际上是一个 UITableView 并且行之间的间隙实际上是具有自定义大小的空白节标题。

我还没有完全实现它,但重要的是:

  • 在 Storyboard 中制作一个新的 UIViewController。
  • 在 ViewController 属性选择器集 PresentationOver Current Context
  • 在 View 中,更改 BackgroundClear Color
  • 添加一个 UITableView。设置左、下、右约束。设置 TableView 的高度,使其仅覆盖 View 的下半部分
  • 更改StyleGrouped
  • 像基于普通原型(prototype)的 TableView
  • 一样实现委托(delegate)
  • 从操作按钮创建一个到 ViewController 的 segue 并设置 SeguePresent Modally
  • 关于ios - 操作表 IOS 中的分段控制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31586639/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com