Skip to content

Commit

Permalink
[add]适配iphonex
Browse files Browse the repository at this point in the history
  • Loading branch information
coderyi committed Oct 22, 2017
1 parent 2ba5425 commit e6aecea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions JPFPSStatus/JPFPSStatus/JPFPSStatus.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ - (id)init {

// fpsLabel
fpsLabel = [[UILabel alloc] initWithFrame:CGRectMake(([[UIScreen mainScreen] bounds].size.width-50)/2+50, 0, 50, 20)];
BOOL isiPhoneX = (([[UIScreen mainScreen] bounds].size.width == 375.f && [[UIScreen mainScreen] bounds].size.height == 812.f) || ([[UIScreen mainScreen] bounds].size.height == 375.f && [[UIScreen mainScreen] bounds].size.width == 812.f));
if (isiPhoneX) {
fpsLabel.frame = CGRectMake(([[UIScreen mainScreen] bounds].size.width-50)/2+50, 24, 50, 20);
}
fpsLabel.font=[UIFont boldSystemFontOfSize:12];
fpsLabel.textColor=[UIColor colorWithRed:0.33 green:0.84 blue:0.43 alpha:1.00];
fpsLabel.backgroundColor=[UIColor clearColor];
Expand Down

0 comments on commit e6aecea

Please sign in to comment.