【问题标题】:Keep ios6 disclosure indicator apparence in ios7在 ios 7 中保持 ios 6 披露指示器的外观
【发布时间】:2013-12-06 19:56:59
【问题描述】:

iOS 披露指示器在 ios7 中更改了外观;它现在是褪色的灰色。 不幸的是,我的应用程序有很多页面(超过 100 个)具有不同的部分和背景颜色。在ios6上没有问题,但是在ios7上,新的披露指示器在某些部分的背景上是不可见的。

我需要一个解决方案,因为我没有时间更改超过 100 个页面背景,即使我这样做了,如果颜色显示指示器在 ios7 中看起来还不错,在 ios6 中就不行,反之亦然。

【问题讨论】:

    标签: ios6 uitableview ios7 indicator disclosure


    【解决方案1】:

    设置表格视图的tintColor。这将为单元格上的披露指示器着色。

    请注意,tintColor 属性仅在 iOS 7 下可用,因此请正确编码:

    if ([self.tableView respondsToSelector:@selector(setTintColor:)]) {
        self.tableView.tintColor = ... // the desired color
    }
    

    【讨论】:

    • 你确定吗?这对我不起作用。尝试在 Storyboard 和 ViewDidLoad 中设置它。
    【解决方案2】:

    是否可以为 ios7 创建自定义图像,并在数据源“cellForRowAtIndexPath”等方法中设置问题单元格的附件视图,如下所示?

    if(UIDevice.currentDevice.systemVersion.floatValue >= 7)
    {
    
        UIImageView* customDisclosureImageView = [[UIImageView alloc] initWithImage:normalImage];
        customDisclosureImageView.highlightedImage = selectedImage;
        cell.accessoryView = customDisclosureImageView;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多