ios - MKOverlayView and changing its alpha -


i have custom mkoverlay , mkoverlayview. when mkoverlayview created, can set alpha of view:

-(void)drawmaprect:(mkmaprect)maprect zoomscale:(mkzoomscale)zoomscale incontext:(cgcontextref)context {     datasetoverlay *datasetoverlay = (datasetoverlay *)self.overlay;      uiimage *image = [uiimage imagewithdata:datasetoverlay.imagedata];      cgimageref imagereference = image.cgimage;      mkmaprect themaprect = [self.overlay boundingmaprect];     cgrect therect = [self rectformaprect:themaprect];      cgcontextscalectm(context, 1.0, -1.0);     cgcontexttranslatectm(context, 0.0, -therect.size.height);     cgcontextsetalpha(context, 1);     cgcontextdrawimage(context, therect, imagereference); } 

but want able change alpha of view after draw.

how can that?

i have not worked core graphics yet.

-(void)drawmaprect:(mkmaprect)maprect zoomscale:(mkzoomscale)zoomscale incontext:(cgcontextref)context {     dlog(@"fired");     datasetoverlay *datasetoverlay = (datasetoverlay *)self.overlay;      uiimage *image = [uiimage imagewithdata:datasetoverlay.imagedata];      cgimageref imagereference = image.cgimage;      mkmaprect themaprect = [self.overlay boundingmaprect];     cgrect therect = [self rectformaprect:themaprect];        cgcontextscalectm(context, 1.0, -1.0);     cgcontexttranslatectm(context, 0.0, -therect.size.height); //    cgcontextsetalpha(context, 1);     cgcontextdrawimage(context, therect, imagereference); } 

k, @ttarules's comment, did testing , realized needed remove cgcontextsetalpha() , set alpha mkoverlayview's alpha property. can change alpha outside of initialization , give me need.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -