ios - Any workaround to have different constraints for same size class? -


say need have view has leading , trailing spacings, on iphone se spacings should 16, on larger phones can have 32 spacing, in portrait mode horizontal size class compact, means can't apply different spacings different size classes.

then thought having high priority constraints instead of required, , make intrinsic content size of view be, say, 288, on iphone se, spacings have 16 , 16 (ie. 16 + 288 + 16 = 32), on larger phones can 32. haven't tried can point me correct direction of solving problem?

thanks!

edit: view uilabel, , don't want give hardcoded width constraint.

i solve these issues more using constraint multiplier. may not 16/32 can similar effect.

you can set hard limits required min 16, required max 32 , set lower priority constraint of parent width * somemultiplier


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -