gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:08:58 27 4
gpt4 key购买 nike

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

right sectionIndex

最佳答案

Try this solution, this will definitely help you ->

Step 1) Add this method in your class

- (void)setUITableViewSectionIndexFontSize:(UITableView*)tableView{
//UI the index view
for(UIView *view in [tableView subviews]) {
if([view respondsToSelector:@selector(setIndexColor:)]) {
[view performSelector:@selector(setIndexColor:) withObject:[UIColor grayColor]];

if ([view respondsToSelector:@selector(setFont:)]) {
[view performSelector:@selector(setFont:) withObject:[UIFont systemFontOfSize:20.0]];
[view performSelector:@selector(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/

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