How can I draw two different rectangles with black background without using subclass of UIView and using a CGContext?
How can I draw two different rectangles with black background without using subclass of
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Add whatever vanilla UIView objects you need in the appropriate positions, and set their background colours to whatever you like.
The drawing will be done in a CGContext, you just won’t be able to control it.
Or, add a CALayer subclass of your own, set it to be the view’s layer and draw your rectangles in there, in
drawInContext:.Or, set a different object as the delegate for the view’s layer and draw it in the delegate method
drawLayer:inContext:.