Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

适配iPhone XS Max #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions iOS/Demo/LiteApp/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,12 @@ @implementation ViewController
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];

_asset =[[QIYIAssetsImpl alloc] init];
_asset = [[QIYIAssetsImpl alloc] init];
_delegateImpl = [[QIYIDelegateImpl alloc] init];
QIYIMPViewNavController* vc = [QIYIMPViewNavController alloc];
vc = [vc init:_asset delegate:_delegateImpl];
[self presentViewController:vc animated:YES completion:^{
}];
QIYIMPViewNavController *viewController = [QIYIMPViewNavController alloc];
viewController = [viewController init:_asset delegate:_delegateImpl];
viewController.modalPresentationStyle = UIModalPresentationOverFullScreen;
[self presentViewController:viewController animated:YES completion:nil];
}


- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}


@end
14 changes: 9 additions & 5 deletions iOS/LiteAppSrc/Common/QIYICommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@
#define __SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define __SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
#define __NAVIGATION_HEIGHT 44.0f
#define __NAVIGATION_BUTTON_SIZE 32.0f
#define __NAVIGATION_OFFSET ((__IS_IPHONE_X == YES) ? 44.0f : 20.0f)
#define __NAVIGATION_BAR_HEIGHT ((__IS_IPHONE_X == YES) ? 88.0f : 64.0f)
#define __TABBAR_HEIGHT ((__IS_IPHONE_X == YES) ? 83.0f : 49.0f)
#define __NAVIGATION_BUTTON_SIZE 32.0f

#define __IS_IPHONE_X ((__SCREEN_HEIGHT == 812.0f) ? YES : NO)
// iPhoneX iPhoneX_MAX适配
#define __XH_iPhoneX (__SCREEN_WIDTH == 375.f && __SCREEN_HEIGHT == 812.f ? YES : NO)
#define __XH_iPhoneX_MAX (__SCREEN_WIDTH == 414.f && __SCREEN_HEIGHT == 896.f ? YES : NO)
#define __XH_iPhoneX_X (__XH_iPhoneX || __XH_iPhoneX_MAX)

#define __NAVIGATION_OFFSET ((__XH_iPhoneX_X == YES) ? 44.0f : 20.0f)
#define __NAVIGATION_BAR_HEIGHT ((__XH_iPhoneX_X == YES) ? 88.0f : 64.0f)
#define __TABBAR_HEIGHT ((__XH_iPhoneX_X == YES) ? 83.0f : 49.0f)