How to define Vary for Traits for a button in swift3

0

I have problems to implement a design for a button, what I am trying to do is that my button in the vertical view only shows a centered image and when it is horizontal it shows an image and a title aligned to the right, I have been trying to use Vary for Traits but when I give the design to my button vertically and then horizontally the styles are not respected.

My vertical view looks like this:

Then in my horizontal view I activate the Vary for traits first and modify my button:

The problem is that if I return to the vertical view, the changes that I only wanted to see horizontally were also made in the other view:

    
asked by Enrique Espinosa 29.05.2018 в 18:34
source

1 answer

0

1- select vary for trait in portrait 2- add your button and style 3- select done variyng 4- select landscape orientation 5- select vary for trait 6- Add to button and style 7- select done variyng

To assign actions to these buttons in the ViewController where the button is from the yellow icon, drag it to the destination ViewController. Assign an identifier to the created segue.

To the buttons assign this action that will perform the action of the following:

   @IBAction func buttonAction(_ sender: UIButton){
    performSegue(withIdentifier: “segueId”, sender: self)
}

    
answered by 30.05.2018 / 18:46
source