File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,13 @@ @implementation TKChatRoomSensitiveViewController
20
20
21
21
- (instancetype )initWithNibName : (NSString *)nibNameOrNil bundle : (NSBundle *)nibBundleOrNil {
22
22
if (self = [super initWithNibName: nibNameOrNil bundle: nibBundleOrNil]) {
23
- _tableViewInfo = [[objc_getClass (" MMTableViewInfo" ) alloc ] initWithFrame: [UIScreen mainScreen ].bounds style: UITableViewStyleGrouped];
23
+ // 增加对iPhone X的屏幕适配
24
+ CGRect winSize = [UIScreen mainScreen ].bounds ;
25
+ if (winSize.size .height == 812 ) {
26
+ winSize.size .height -= 88 ;
27
+ winSize.origin .y = 88 ;
28
+ }
29
+ _tableViewInfo = [[objc_getClass (" MMTableViewInfo" ) alloc ] initWithFrame: winSize style: UITableViewStyleGrouped];
24
30
_tableViewInfo.delegate = self;
25
31
}
26
32
return self;
Original file line number Diff line number Diff line change @@ -22,7 +22,13 @@ @implementation TKSettingViewController
22
22
23
23
- (instancetype )initWithNibName : (NSString *)nibNameOrNil bundle : (NSBundle *)nibBundleOrNil {
24
24
if (self = [super initWithNibName: nibNameOrNil bundle: nibBundleOrNil]) {
25
- _tableViewInfo = [[objc_getClass (" MMTableViewInfo" ) alloc ] initWithFrame: [UIScreen mainScreen ].bounds style: UITableViewStyleGrouped];
25
+ // 增加对iPhone X的屏幕适配
26
+ CGRect winSize = [UIScreen mainScreen ].bounds ;
27
+ if (winSize.size .height == 812 ) { // iPhone X 高为812
28
+ winSize.size .height -= 88 ;
29
+ winSize.origin .y = 88 ;
30
+ }
31
+ _tableViewInfo = [[objc_getClass (" MMTableViewInfo" ) alloc ] initWithFrame: winSize style: UITableViewStyleGrouped];
26
32
}
27
33
return self;
28
34
}
You can’t perform that action at this time.
0 commit comments