xcode - The iOS rotation with auto layout -


i followed swift ios tutorial on itunes (stanford university cs193p)

i followed first example make calculator.

1.i add button screen , set auto layout attributes.

enter image description here

2.then warning comes out, , update frames constraints.

enter image description here

3.the start simulator, seems works fine.

enter image description here

  1. but when rotated screen, number buttons heap together.

enter image description here

i know must made small mistakes, followed tutorial. because new ios, , thought problem hard describe, put there. hopefully, there 1 solve problem.

you have problem because made constraints using wany hregular size class. when rotate landscape, height compact, , don't have constraints size class (so buttons have {0,0} origin). should make separate constraints size class, 3 rows of 4 rather 4 rows of 3 fit shorter space better.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -