Suppose that I have a Custom View that I need to set up to display. The Custom View has about three or four subviews that I need to add. I'm still a little confused when I should be using drawRect or layoutSubviews to set up a customized view.
The documentation wasn't entirely helpful. Is there any good rule of thumb? I have noticed that some views that I have written do not display correctly if I set it up with layoutSubviews, so I add subviews to the Custom View with drawRect, and things work perfectly. I would rather not use these two with trial and error, so if someone can explain just a little more what is going on (and the difference) with these two methods, I would really appreciate the help.
The documentation wasn't entirely helpful. Is there any good rule of thumb? I have noticed that some views that I have written do not display correctly if I set it up with layoutSubviews, so I add subviews to the Custom View with drawRect, and things work perfectly. I would rather not use these two with trial and error, so if someone can explain just a little more what is going on (and the difference) with these two methods, I would really appreciate the help.