gpt4 book ai didi

ios - 升级到 MT 4.0 后索引 TableViews 不显示

转载 作者:可可西里 更新时间:2023-11-01 04:40:36 28 4
gpt4 key购买 nike

升级到 MT 4.0 后,我以前在右手边显示索引的 TableViews 不再工作了。 tableview 仍然显示在部分中并且工作正常,但索引不显示。

我在 UITableViewSource 中定义了这三种方法,这三种方法似乎都有效:

public override string[] SectionIndexTitles(UITableView tableView)

public override int SectionFor(UITableView tableView, string Title, int atIndex)

public override string TitleForHeader(UITableView tableView, int section)

还有其他人遇到这个问题吗?这是 MT 4.0 的错误吗?

最佳答案

这是一个 known bug .

看来 UITableView 没有保留返回的数组,你可以使用在我们进一步调查此问题时,请执行以下操作来解决此问题:

NSArray array;

[Export ("sectionIndexTitlesForTableView:")]
public NSArray SectionTitles (UITableView tableview)
{
if (array == null) {
string[] titles = new string[RowsInSection(tableview, 0)];
for (int index = 0; index < titles.Length; index++)
titles[index] = index.ToString();

array = NSArray.FromStrings (titles);
}

return array;
}

关于ios - 升级到 MT 4.0 后索引 TableViews 不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5627039/

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