Alternative method for canDrawSubviewsIntoLayer prior to OSX 10.9

I needed to implement the following code in my image view in order to properly set the gif:

self.homeView.radarImageView.animates = YES; self.homeView.radarImageView.canDrawSubviewsIntoLayer = YES; self.homeView.radarImageView.image = currentData.radarImage; 

Unfortunately, the canDrawSubviewsIntoLayer method canDrawSubviewsIntoLayer not compatible with OSX until 10.9. Is there an alternative approach that I can use that will make this work in OSX 10.7 and higher?

0
source share
1 answer

avoid views based on layers below 10.8 and below, as they don't seem to mix with animated gifs

see: How to display an animated GIF in Objective-C on top of a layered view?

edit:

as indicated in the comment, you can draw gradients (and all other effects without using layers)
For gradients, for example, there is an NSGradient that accepts NSColors and can fill a rectangle

shameless plug:

NSView that can draw everything you ever wanted in its background: color, gradient, patttern image, just image, frame, rounded corners ... all in one view https://github.com/Daij-Djan / DDBackgroundView

0
source

Source: https://habr.com/ru/post/970121/


All Articles