Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the sizes in portrait mode for iPhone 6 and iPhone 6 plus

Size classes :

compact width any height for all compact width layout (all phones except iPhone 6 plus)

compact width regular height for all iphone in potrait

any width compact height for all iphone in landscape (except iphone 6 plus)

regular width compact height (for iPhone 6 plus) iphone 6 plus in landscape

Now i have label and i change the font size for iPhone 6 and iPhone 6 plus e.g for "compact width any height" its "12" and for "compact width regular height" its "15" in portrait . the size is 15 for all iPhones in portrait.

But it is all right in landscape when i change the font size of "any width compact height" to "12" and "regular width compact height" to "15" its working fine .

My Question is that how should i do the same for portrait ???

like image 709
Raheel Mateen Avatar asked Jan 08 '23 08:01

Raheel Mateen


1 Answers

[self setFont:[UIFont fontWithName:@"HelveticaNeueLTStd-Lt" size:49.0]];

Set the font size now i calculate the size with respect to ratio .

As we know iPhone 5 is 85.3 % smaller than iPhone 6 so after some research...

if (IS_IPHONE_6)
        [self setFont:[UIFont fontWithName:self.font.fontName size:(self.font.pointSize)*1.18]];
        else if (IS_IPHONE_5)
        {
        [self setFont:[UIFont fontWithName:self.font.fontName size:(self.font.pointSize)]];
        }
        else
        {
            [self setFont:[UIFont fontWithName:self.font.fontName size:(self.font.pointSize)*1.3]];

        }

This will solve my problem ......

like image 182
Raheel Mateen Avatar answered Jan 19 '23 07:01

Raheel Mateen