Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIView frame change Notification

Is there any notification when frame or bounds of UIView changes? Whenever frame of a UIView changes, I need to calculate and set the frame of its custom subview so that it aspect fits in the superview.

NSView has the notification NSViewFrameDidChangeNotfication for the purpose. Why is this not there for UIView?

like image 805
spd Avatar asked May 25 '11 03:05

spd


1 Answers

There is no notification. You can subclass UIView to override layoutSubviews, to either do the layout directly or send the necessary notification.

Have you tried setting an appropriate autoresizingMask so the subview gets resized automatically?

like image 186
Anomie Avatar answered Oct 21 '22 02:10

Anomie