简体   繁体   English

UITableView标头视图

[英]UITableView header view

I have 3 different instances of tableview in Nib, where I am displaying all these tableview in a page control. 我在Nib中有3个不同的tableview实例,在这里我在页面控件中显示所有这些tableview。 And delegate and data source for all the 3 tableview is same. 并且这三个tableview的委托和数据源都是相同的。

Problem here is, Header view is appearing in one tableview and disappearing in others when I change the Page of the UIPageControl ? 这里的问题是,当我更改UIPageControl的Page时,标题视图出现在一个表视图中,而在另一个视图中消失。

Any idea how can I resolve this issue ? 您知道如何解决此问题吗?

Since it's not possible for a view to be a subview of more than one view at a time, using the same view as a header for multiple table views will result in odd visual artifacts (views disappearing one place and showing up somewhere else). 由于一个视图不可能一次是一个以上视图的子视图,因此将同一视图用作多个表视图的标题将导致奇怪的视觉伪像(视图消失在一个地方并显示在其他地方)。 You can add one header view per table view to your nib, or generate a header view for each programmatically, and assign them at run-time. 您可以将每个表视图的一个标题视图添加到笔尖,或以编程方式为每个表视图生成一个标题视图,然后在运行时分配它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM