M
M
Maxim Prigozhenkov2015-10-11 16:01:56
Objective-C
Maxim Prigozhenkov, 2015-10-11 16:01:56

How to apply pictures of different sizes in Storyboard?

There is a slicing of images: img.png, [email protected] and [email protected], which is located in Assets.xcassets. Pictures must be applied to buttons (UIButton) that have bindings to the edges of the screen and to each other using AutoLayout. In fact, when the screen is resized (From IPhone5 to IPhone6), the pictures should also resize, but this does not happen.
What is the best way to implement such multidimensional buttons?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Squatch, 2015-10-11
@Waka_Waka

In fact, when you change the screen size (From IPhone5 to IPhone6), the pictures should also resize

In general, this is not standard behavior. According to the Human Interface Guidelines , the @3x suffix is ​​only used on the iPhone 6 Plus and 6S Plus .
If the application design assumes a different layout for iPhone 5 and 6 (different frame sizes for buttons, for example, using Size Classes), then different pictures can be set programmatically.
But in general it sounds like a task - far from generally accepted practices. Apple is pushing the concept of uniform design for the iPhone 4s/5/6 and design customization for the iPhone 6 Plus. In the storyboard, this can be achieved using Size Classes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question