Skip to content

Commit

Permalink
修复浏览沙盒文件不能看到底部文件问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Wu committed May 7, 2019
1 parent 17271c0 commit 1122171
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions iOS/DoraemonKit/Src/Core/Plugin/AppInfo/DoraemonAppInfoUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,7 @@

+ (NSString *)bluetoothAuthority;

+ (CGFloat)naviationHeight;

+ (UIEdgeInsets)safeAreaInsets;
@end
14 changes: 14 additions & 0 deletions iOS/DoraemonKit/Src/Core/Plugin/AppInfo/DoraemonAppInfoUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -348,5 +348,19 @@ + (NSString *)bluetoothAuthority{
return @"";
}

+ (CGFloat)naviationHeight
{
return CGRectGetHeight([UIApplication sharedApplication].statusBarFrame) + 44;
}
+ (UIEdgeInsets)safeAreaInsets
{
UIEdgeInsets insets = UIEdgeInsetsZero;
if (@available(iOS 11.0, *))
{
insets = [UIApplication sharedApplication].keyWindow.safeAreaInsets;
}
return insets;
}


@end
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ - (void)initData{
- (void)initUI{
self.title = DoraemonLocalizedString(@"沙盒浏览器");
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.bigTitleView.doraemon_bottom, self.view.doraemon_width, self.view.doraemon_height-self.bigTitleView.doraemon_bottom) style:UITableViewStylePlain];
self.tableView.tableFooterView = [UIView new];
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.view addSubview:self.tableView];
Expand All @@ -73,7 +74,11 @@ - (void)loadPath : (NSString *)filePath{
model.type = DoraemonSandboxFileTypeBack;
self.bigTitleView.hidden = YES;
self.navigationController.navigationBarHidden = NO;
self.tableView.frame = CGRectMake(0, 0, self.view.doraemon_width, self.view.doraemon_height);
CGFloat height = self.view.doraemon_height;
if (height == CGRectGetHeight([UIScreen mainScreen].bounds)) {
height = self.view.doraemon_height - [DoraemonAppInfoUtil naviationHeight] - [DoraemonAppInfoUtil safeAreaInsets].bottom;
}
self.tableView.frame = CGRectMake(0, 0, self.view.doraemon_width, height);
self.edgesForExtendedLayout = UIRectEdgeNone;
NSString *dirTitle = [fm displayNameAtPath:targetPath];
self.title = dirTitle;
Expand Down

0 comments on commit 1122171

Please sign in to comment.