AutoresizingMask for fixed margin sizes

In a view containing several subzones, one of the subzones must remain fixed, a non-zero distance from the top and bottom of the supervisor. In these images, this view is grayed out:

Portait

Landscape

According to the documentation, this view should have a mask UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth. However, this leads to the fact that the view increases its height in order to seize all control. How can a view be contained in fixed but nonzero fields? Thank.

+3
source share
1 answer

UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth must work.

UIView, / ( , ) — , / UIView .

initWithFrame: CGRectZero; , - subview.frame = self.bounds, self.bounds CGRectZero ( ).

setFrame: setBounds: NSLog.

+2

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


All Articles