(iphone) set view frames beyond surveillance?

I noticed that I can place a subview outside the supervisor limit (partially or fully).
I wonder how acceptable this is since it looks abnormal in normal iphone programming programming.

Thanks.

+4
source share
2 answers

This is an acceptable and sometimes common practice - custom implementations of scroll views or other β€œcomposite” views, for example, usually place or move objects outside the boundaries of surveillance.

You might be interested in the UIView property clipsToBounds , which restricts the drawing of a subview to just the borders of the surveillance.

+8
source

Also note that subselects outside boundaries pose a problem when implementing accessibility.

The availability frame is displayed in order, but appears only when you select an area of ​​the specified frame when you touch inside the boundaries of the parent. If the subview completely goes beyond the parental boundaries, it is only available when scrolling sideways with VoiceOver turned on. When dragging around the screen, the touch screen will be displayed only when viewing the specified sub-view within the parental boundaries.

+1
source

Source: https://habr.com/ru/post/1344946/


All Articles