-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request: Allow non-template Images or Access to the ImageView in some way #19
Comments
…the imageView and headingImageView to be set as is instead of with the UIImageRenderingModeAlwaysTemplate Rendering Mode. Defaults to YES as to not change anything for those who would update to this commit and still want the Rendering Mode defaulting to Template. Fixes issue TransitApp#19 on SVPulsingAnnotationView.
The Above reference to #20 (Allows fix for issue #19 where Images set are always Template.) will fix this issue. Going to close this Issue. If the #20 Pull request doesn't get merged, feel free to use it from my Fork. |
…the imageView and headingImageView to be set as is instead of with the UIImageRenderingModeAlwaysTemplate Rendering Mode. Defaults to YES as to not change anything for those who would update to this commit and still want the Rendering Mode defaulting to Template. Fixes issue TransitApp#19 on SVPulsingAnnotationView.
Correct me if I'm wrong, but whenever an image is set to the
SVPulsingAnnotationView
, it is set to the privateimageView
with theUIImageRenderingModeAlwaysTemplate
Rendering Mode and uses theannotationColor
as thetintColor
of thatimageView
(Lines 152 and 165 of SVPulsingAnnotationView.m as of this commit - 29th July 2015). This means if, for example, the annotation's pulse color was to be the default blue, but the image was a different color, say red, it would always render as blue.It would be nice if the image could be set to the
imageView
as the actual image set to that property. Alternatively, as it's already usingUIImageRenderingModeAlwaysTemplate
as default, aBOOL
property could be added to the class such assetImagesAsTemplate
which defaults toYES
and then wherever images are being added, that Boolean could be used to determine whether to set the image as Template or not. Doing this would mean any previous users wouldn't have to do anything and this issue would be fixed.I think that #15 (image stays behind the dot) may possibly be referring to this issue but #15 is very vague. I might create a Pull Request with the above proposed changes in the next few days but for now my work around in a subclass is as follows overriding two methods:
This sets the image called imageWeWant to the
imageView
in thesetImage:
method by scanning the subviews for animageView
and setting that image to theimageView
'simage
property without any other rendering. ThesetImage:
method would get called for the empty image also, though at that point there doesn't seem to be animageView
in the subviews, and instead just allows for theimageView
to be added whenrebuildLayers
is called within the super (SVPulsingAnnotationView) implementation ofwillMoveToSuperview:
.TL;DR:
The Above Block of code is a workaround for this issue. Will attempt the proposed changes in the second paragraph (not the above block of code) and create a Pull Request soon to hopefully fix the issue.
Hopefully I haven't missed something which is already implemented to help this issue. Let me know :).
The text was updated successfully, but these errors were encountered: