-
Notifications
You must be signed in to change notification settings - Fork 68
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
Mask problem with renderInContext of CALayer #12
Comments
I am not sure how to solve this problem without rewriting the switch to draw with core graphics. I am open to any ideas on how to change the way the masking currently works to fix it. |
I wasted two days, but finally i had to create my own logic. I have solved this problem by a tricky logic. I created following code to get UIImage from UIView.subviews.
|
Thanks hackiftekhar! Your tricky solution worked. Just had to modify a little according to my view setup. |
most welcome. |
When using renderInContext method of CALayer the mask layers are not rendered. The result looks ugly, the entire track image is show in the UIImage.
I know the real problem is that renderInContext does not support mask layer -- but is there something that can be done in TTSwitch to address this? My app requires screenshot of UIView which contains the Switch. I just finished replacing all the Swtiches in the app with TTSwitch... would hate to revert back to UISwitch.
Test code to reproduce the issue (modified the example project):
The text was updated successfully, but these errors were encountered: