T
T
tiger_132019-11-18 21:48:16
Swift
tiger_13, 2019-11-18 21:48:16

What is the best way to implement the design?

There is a design idea, in finished form it +- looks like this:
There are three buttons and an inscription:
5dd2e5294d887712137137.jpeg
When you click on the "add icon" button (select an icon), a UIImageView appears, with the selected icon: The
5dd2e5993e253110013844.jpeg
question is:
How to add this UIImageView , if the entire design is built on AutoLayout (and spacing between elements is also specified)?
I understand that if you initially add a UIImageView, and just put isHidden, then the user will see an empty space.
Remove spacing at the place of adding the image, and register, given the new UIImageView ?
PS
in my design, not only a new UIImageView appears after selection, but a whole UIVIew, with new elements:
it was:
5dd2e6e04631c327033836.png
it became:
5dd2e6f2bb07b685415300.png
where to put the old buttons? just .removeFromSuperview()?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
briahas, 2019-11-18
@tiger_13

Alternatively, redesign. In modern applications, they show the default icon and, usually, clicking on it opens the icon change flow.
If you somehow do what you described, then you can put a UIImageView right away, just without a picture. As a result - until the picture is set, the element will collapse; when the picture is installed - appears.

U
uzolenta, 2019-11-24
@uzolenta

Use a StackView, put the necessary elements there that you want to "collapse" if they are without data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question