Ios 如何设置UITableView右部分索引的字体大小?
如何设置Ios 如何设置UITableView右部分索引的字体大小?,ios,uitableview,fonts,Ios,Uitableview,Fonts,如何设置UITableView右侧部分索引的字体大小 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 s
UITableView
右侧部分索引的字体大小
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];
请检查此链接@UmaMadhavi它没有用显示您的一些代码@coderyl抱歉,没有任何有意义的代码,只想设置sectionIndex@MayankPatel@CoderYL您应该参考uma Madhavi的链接此解决方案很接近,但如果tableview中有搜索字段,在搜索字段中按“取消”后,大小不会更新。我想不出如何使它工作。