如何将子视图添加到仅覆盖表格单元格但不覆盖表头视图的表视图
我使用 UISegmentedControl 作为表视图的标题视图。现在我想添加加载视图(我自己定义的视图),仅覆盖表格单元格,但不覆盖我的标题视图。我该如何实现这一目标?
I'm using a UISegmentedControl as the headerview of a tableview. Now I want to add loading view (a view defined by myself) only covering the table cells but not my headerview. How do I achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将此视图添加到所需的单元格中:
You can add this view to the cell you want:
添加加载视图的最简单方法是这样的
* 将视图添加到窗口可能不是您设计的最佳选择,但由于我不知道视图层次结构的任何细节,因此这就是永远会起作用。
注意:如果您没有遮盖分段控件,并且启用了它,则用户可能会在您不期望的情况下单击它并更改应用程序的状态 - 例如当您尝试加载某些内容时对于他们来说。确保如果用户更改应用的状态,您可以取消此加载视图。
The simplest way to add the loading view would be like this
* Adding the view to the window may not be the best thing for your design, but since I don't know any of the details of your view hierarchy, this is the way that will always work.
Caution: If you do not cover up the segmented control, and it is enabled, the user may click on it and change the state of the app when you aren't expecting it - like when you're trying to load something for them. Be sure that you can cancel this loading view if the user changes the state of the app.