Localized index for UITableView

主宰稳场 提交于 2019-12-21 09:16:38

问题


I'm trying to use a localized index for my UITableView same as iPhone's Contacts application . here is how I return an array of characters:

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
    return [[UILocalizedIndexedCollation currentCollation] sectionIndexTitles];
}

I changed the language setting to a non-English (Ex: Russian). However, it always returns an array of character in English:

|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|#

It is unlike the iPhone Contacts application which shows the index with merged Russian and English characters.

Is there anyway to get the localized array of characters?


回答1:


You can use CLDR's 'index characters' as I described here: C#: get letters of alphabet for scandinavian language?
That function probably does the same internally, or it wants to.



来源:https://stackoverflow.com/questions/2909084/localized-index-for-uitableview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!