dimanche 28 juin 2015

Resize UIButtons from swift once constraints are set

I was looking at this youtube video regarding How Priority Constrains works. I want to do the same but instead of label I am using custom buttons with images. As you can see in the video, the author hardcoded the size of the label to 100wx100h. However regardless of the what iphone you have, the labels always be the same size. I want to accomplish the same thing, but instead I want the size of buttons (or in his case labels) be larger on iphone 5, and even larger in iphone 6 and so on. My question is how can I accomplish this? Also is it possible design this with let say 100X100 in 3.5-inch iphone then change the size dynamically change in the code depends what iphone is used? if iphone4s then use 100X100 size buttons else if iphone 5 then use 110X110 size buttons and so on? Thanks

Aucun commentaire:

Enregistrer un commentaire