سؤال

I have a class derived from UIView, it represents a square area(280x280) over which objects will be drawn, but somehow only the upper portion(280x187) was drawn.

I checked the bounds and frame within the initWithCoder and drawRect of the custom view class, the results are:

initWithCoder-->bounds:(280x280); frame:(280x280)

drawRect------->bounds:(280x187); frame:(280x187)

What could possible happen between initWithCoder and drawRect methods that changed both the bounds and frame?

Thanks for the information.

هل كانت مفيدة؟

المحلول

Inside InterfaceBuilder, I turned off the autoresize of view and took out the springs and struts, then the view displayed properly.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top