I have it working perfectly - except I need to write some text over a custom button. So I subclassed UIButton. In -drawrect, I write the text I need. The problem is that the Any ideas? I know this is a dumb newbie When is 'drawRect' called? Ask Question. Asked 11 years, 8 months ago.
Active 11 years, 8 months ago. Viewed 6k times. Improve this question. Peter Hosey Egil Egil 91 1 1 silver badge 3 3 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. Ken Ken I think he means viewWillAppear - and it happens every time the view appears. But wouldn't 'willAppear' be called before 'draw'? As we can see, the use of UIColor avoids the necessity to create colorspaces and components when working with colors.
Refer to the Apple documentation for more details of the range of methods provided by the UIColor class. This chapter has covered some of the basic principles behind the drawing of two dimensional graphics on the iPhone using the Quartz 2D API.
Topics covered included obtaining the graphics context, implementing the drawRect method and the handling of colors and transparency. Jump to: navigation , search.
Navigation menu Personal tools. Namespaces Page Discussion. Views Read View source View history. This page was last modified on 27 October , at Copyright Payload Media, Inc. All Rights Reserved. Viewed 7k times. Is it invoked just before the main view is going to be shown Can we call it whenever we want? Improve this question. TechZen 64k 15 15 gold badges silver badges bronze badges. Add a comment. Active Oldest Votes. It's called whenever the view or part of the view needs to be drawn or redrawn.
Improve this answer. TechZen TechZen 64k 15 15 gold badges silver badges bronze badges. Sign up or log in Sign up using Google.
0コメント