I have a subclass of UIView in which it has a drawRect in it. It basically draws a line and an image.
I have drawn this in viewDidLoad, but need to change the layout when the view changes to landscape. How can I redraw this?
I have a subclass of UIView in which it has a drawRect in it.
Share
Set the view’s
contentModetoUIViewContentModeRedraw. The view will call[self setNeedsDisplay]whenever its bounds change. You will only have to resize the view as needed.