OGeek|极客世界-中国程序员成长平台

标题: ios - 如何设置 UITableView 右侧 sectionIndex 的字体大小? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 13:25
标题: ios - 如何设置 UITableView 右侧 sectionIndex 的字体大小?

如何设置UITableView右sectionIndex的字体大小?

right sectionIndex



Best Answer-推荐答案


Try this solution, this will definitely help you ->

Step 1) Add this method in your class

- (void)setUITableViewSectionIndexFontSizeUITableView*)tableView{
    //UI the index view
    for(UIView *view in [tableView subviews]) {
        if([view respondsToSelectorselector(setIndexColor]) {
            [view performSelectorselector(setIndexColor withObject:[UIColor grayColor]];

            if ([view respondsToSelectorselector(setFont]) {
                [view performSelectorselector(setFont withObject:[UIFont systemFontOfSize:20.0]];
                [view performSelectorselector(setBackgroundColor withObject:[UIColor blueColor]];

            }
        }
    }
}

Step 2) Now add this line just before [tableView reloadData] line ->

[self setUITableViewSectionIndexFontSize:tableView];
[tableView reloadData];

关于ios - 如何设置 UITableView 右侧 sectionIndex 的字体大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34715831/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4