Stella
Stella

Reputation: 1868

Xcode 7: UITextview doesn't aligned properly for 3 different sizes iPhone screen

I am trying to use adaptive layout in Xcode 7.1 for iPhone app. I am using 3 sizes iPhone device 5.5, 4.7 and 4.0 inches. When I added a background UIImageview, it fits nicely on all 3 iPhone screens. Please refer attached screenshot. I did pin option to Add 4 sides constraints with 0 values. Background fits to all 3 iPhone sizes screen fine.

Now, I am trying to add a UITextview in all 3 iPhone sizes screen. Now, this text view doesn't fit properly in all 3 iPhone sizes screen

Please find the screenshot reference below. How to make this textview properly placed on all 3 iPhone screens just below Employee ID label?

enter image description here

Upvotes: 0

Views: 255

Answers (2)

abrar ul haq
abrar ul haq

Reputation: 404

You have to set constraints to fit textfield properly. Firstly you have to set size class before setting constraints to handle orientation. like size class with respect to device size in this screen shot size class RH/CW set for portrait orientation. And set set constraints to fit UITextfield enter image description here

Upvotes: 0

Bhavin Bhadani
Bhavin Bhadani

Reputation: 22374

Follow this image and set your constraints like wise....

enter image description here

Upvotes: 2

Related Questions