I have a label. But on the ipad and iphone it is displayed differently. It is necessary that the text increases on the ipad, but on the iphone it decreases. How to do it?
- oneTry to write more detailed questions. Explain exactly what you see the problem, how to reproduce it, what you want to get as a result, etc. - Nicolas Chabanovsky ♦
- font size or UILabel size? - Max Mikheyenko
|
2 answers
There are three simple options for how to do this:
- If you are using constraints, then bind the label to the right and left edges, and put stretching.
- If you are using an autoresizing mask, then do the same, bind it to the left and right, and stretch it.
- The simplest option is to prescribe in the code all this relative to the screen, taking as a basis the width of the screen of the device on which the
[UIScreen mainScreen].bounds.size.widthprogram will run and to set the label frame from it.
|
