The first view is actually 200 x 100. However, views inside are not cropped unless you use clipsToBounds .
The preferred solution to your problem is to stop adding views that exceed dimensions, or to stop resizing so that they fill up the available space as needed.
(To really calculate the full boundaries, including all subviews in the hierarchy, itβs not difficult, just a lot of work that really wonβt take you anywhere. UIView allows UIView to resolve views more than their containers, but this does not necessarily give any guarantees as to that will work properly and is likely to be the source of errors, if you use them. The reason for clipsToBounds probably lies in the fact that the cut-off is expensive, but necessary during the animation when subventions can temporarily move from ranitsy for effect purposes before they are removed from the view.)
Jesper
source share