M
M
mr_drinkens892016-09-07 22:46:27
Objective-C
mr_drinkens89, 2016-09-07 22:46:27

How to correctly set constraints?

Good day.
I've been learning iOS development for a while now.
Situation: there is a TableView with a UITableViewCell in it. Well, there are 2 buttons on this cell: left and right.
When you look on the iPad - everything is OK, when on the iPhone - the right button is not visible.
I understand that the window size in the storyboard is universal 600x600, and then it is already necessary to set constraints.
Tell me, for this example, how it will look like?
Thanks to

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Petrushka, 2016-09-08
@petruska

Draw how you want

M
Maxim Globak, 2016-09-08
@maximglobak

You set the anchor for the left button to:
left edge (fixed value)
top (fixed)
bottom (fixed)
right edge (to the right button fixed) You
bind the first button to:
right edge (fixed)
up and down (fixed)
Not correct about the left edge , but you can also try to bind it to the left button with the same value that you tied the left button to the right one.
Then you select two buttons and put a constraint for both of them "Same width"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question