iphone - 分段 TableView 索引选择突出显示

标签 iphone objective-c ios uitableview

我觉得这应该是一个简单的属性,但我一直在搜索,但找不到答案。

我的表右侧有一个 TableView 索引。选择后,它会使所有内容变灰。我想模仿 iPod 应用程序,当索引本身被选中时,它是半透明的(可能是 .4f 的 alpha)。

有什么想法吗?

最佳答案

根据我的发现,这可能能够做到(但可能会导致您的应用被拒绝):

- (UITableViewCell *)tableView:(UITableView *)tv 
         cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{    
    for(UIView *view in [tv subviews])
    {
        if([[[view class] description] isEqualToString:@"UITableViewIndex"])
        {
            [view setAlpha:0.4];
        }
    }
    //rest of cellForRow handling...
}

关于iphone - 分段 TableView 索引选择突出显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2304548/

相关文章:

ios - 应用商店中的应用所有权

iphone - 代码签名错误: The identity 'iPhone Developer: x Xxxxx' doesn't match any identity in any profile

iphone - CALayer/CABasicAnimation 不透明动画缓存?

iphone - 自定义 uitableviewcell 的问题

ios - 列出存储在 iBooks 中的文档

ios - 将值从 TableView Controller 传递到 View Controller

iphone - iOS 中的地址簿同步

ios - UIButton 的两种方法?

ios - 向 UIBezierPath 动态添加值

ios - 如何订阅CKShare上的变更?