c# - 为什么我在 UITableView 中有一个空的(但有效的)表索引带?

标签 c# iphone xamarin.ios uitableview

使用 MonoTouch 为客户开发我的第一个 iPhone 应用程序时,我覆盖了 UITableViewDataSource.SectionIndexTitles 函数以提供一个包含我所想内容的 string[] 数组会使字母在垂直带中。

目前我面对的是工作索引带,但没有显示任何字符:

iPhone

(我确实认为 UITableViewDataSource.SectionIndexTitles 具有本地对应的 sectionIndexTitlesForTableView)。

我的问题:

有人可以提示我这里可能做错了什么吗?

我没有所有 A-Z 字符,但缺少一些字符,这可能是个问题?

最佳答案

这是 MonoTouch 中的错误。解决方法是在您的表源类中创建一个新方法并使用 Export 属性对其进行修饰,将 native ObjC 方法传递给重写 (sectionIndexTitlesForTableView:):

string[] sectionIndexArray;
//..
[Export ("sectionIndexTitlesForTableView:")]
public NSArray SectionTitles (UITableView tableview)
{                   
    return NSArray.FromStrings(sectionIndexArray);
}

关于c# - 为什么我在 UITableView 中有一个空的(但有效的)表索引带?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7539038/

相关文章:

c# - 从 Webdings 字体创建系统托盘图标

C# 和 ReSharper : Checking an object's type

iphone - 如何创建分页相机叠加层

ios - InAppSettingsKit自动弹出UINavigationController?

ios - 是否可以获取通过 AirPlay 播放的 HTTP Live Stream 的当前日期?

ios - Xamarin.iOS-状态栏如何更改文本颜色?

c# - 将文件上传到 Telegram

C# 值类型和字符串

validation - Monotouch 用户输入数据验证

ios - DidReceiveNotificationRequest 未被调用