Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

drawRect not called when using auto layout

I'm converting a view from shocks and struts to autolayout but now the custom drawing code that is in drawRect is not being called. Is this expected behavior and if so how can I work around this?

like image 703
adam0101 Avatar asked Oct 19 '13 03:10

adam0101


Video Answer


1 Answers

In your view's init (our in the class where you instantiate your view) set the ContentMode:

yourView.contentMode = UIViewContentModeRedraw;
like image 57
The Windwaker Avatar answered Oct 26 '22 03:10

The Windwaker