How to change iphone CATiledLayer fadeDuration?

后端 未结 3 713
一生所求
一生所求 2020-12-31 02:45

I am working on an iphone application that displays tiled maps. I am currently using a CATiledLayer in a UIScrollView :

     MyTiledDelegate *delegate=[[MyTi         


        
相关标签:
3条回答
  • 2020-12-31 03:23

    You should subclass the CATiledLayer and return fadeDuration of 0 to disable fade-in:

    @interface FastCATiledLayer : CATiledLayer
    @end
    
    @implementation FastCATiledLayer
    +(CFTimeInterval)fadeDuration {
      return 0.0;
    }
    @end
    

    I also had the problem with fade in animation not completing, what helped was to set the background color of the view to [UIColor clearColor]

    0 讨论(0)
  • 2020-12-31 03:29

    Try subclassing and overriding the +fadeDuration accessor on the layer.

    0 讨论(0)
  • 2020-12-31 03:40

    Or in Swift 4:

    class CAFastTiledLayer: CATiledLayer {
        class func fadeDuration() -> CFTimeInterval {
            return 0.0 
        }
    }
    
    0 讨论(0)
提交回复
热议问题