1
votes

With reference to my previously asked question,

Keep single storyboard for iPhone and iPad

I done with above issue. I successfully created the iPhone and iPad design with single storyboard by using

Vary of traits

But now my issue is , I want to make button's different width and height and all related constraints according to the different iPhone screen sizes. If I am using "Vary of traits" it will update button for all screen sizes for iPhone.

For eg:

  1. iPhone 6: I want to set button top constraint from superview is 100
  2. iPhone 5s: I want to set button top constraint from superview is 60

Please suggest me regarding this.

Any help or suggestion appreciated.

1
use adaptivelayoutRocky Balboa
iPhone 6 and iPhone 5s both are in the same category means wC- hR [Portrait], wC- hC[landscape]. So reflects both sides.Go with by code.Pavankumar
Is there any way to do it by storyboard.....Sarabjit Singh
use autolayout and change the topContraint.constant value based on device type. have to do it programaticallySuhit Patil
i tried but its not updating the constants.....Sarabjit Singh

1 Answers

0
votes
topConstraint.constant = xx
self.view.layoutIfNeeded()