扫码关注官方订阅号
如图所示, 当点击字母H时, 改变他的颜色, 我没找到这个方法, 请教一下怎么处理
闭关修行中......
(UITableViewCell )tableView:(UITableView )tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
for(UIView *view in [tv subviews]) {
if([[[view class] description] isEqualToString:@"UITableViewIndex"]) { [view setBackgroundColor:[UIColor whiteColor]]; [view setFont:[UIFont systemFontOfSize:14]]; }
}
//rest of cellForRow handling...
}系统没有提供方法 我们可以遍历subview找到它在返回cell代理里修改Ant-Bang互助社区(Q群 426981364)为你回答
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
(UITableViewCell )tableView:(UITableView )tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
for(UIView *view in [tv subviews])
{
}
//rest of cellForRow handling...
}
系统没有提供方法 我们可以遍历subview找到它在返回cell代理里修改
Ant-Bang互助社区(Q群 426981364)为你回答