Commit f8081a03 authored by 汪洋's avatar 汪洋

iphonex适配

parent af2ee726
......@@ -8,14 +8,12 @@ Pod::Spec.new do |s|
s.source = { :git => 'git@git.wanmeizhensuo.com:gengmeiios/GMBase.git', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.source_files = 'GMBase/Classes/**/*'
s.private_header_files = 'GMBase/Classes/GMBaseUtil.h'
s.dependency 'GMRefresh'
s.dependency 'JSONModel', '1.2.0'
s.dependency 'UITableView+FDTemplateLayoutCell', '1.4'
s.dependency 'GMNetService'
s.dependency 'MBProgressHUD'
s.dependency 'Masonry' , '1.0.1'
s.dependency 'GMPhobos'
s.dependency 'GMHud'
s.dependency 'GMKit'
......
......@@ -7,6 +7,7 @@
//
#import <Foundation/Foundation.h>
#import <Masonry/Masonry.h>
@interface UIFont (GMBase)
+ (UIFont *)navigationFontWithSize:(NSInteger)size;
......@@ -15,3 +16,8 @@
@interface UIColor (GMBase)
+ (UIColor *)colorWithhex:(NSInteger)hex;
@end
@interface MAS_VIEW (GMAdditions)
@property (nonatomic, strong) MASViewAttribute *mas_safeBottom;
@end
......@@ -7,7 +7,7 @@
//
#import "GMBaseUtil.h"
@import GMKit;
@implementation UIFont (GMBase)
+ (UIFont *)navigationFontWithSize:(NSInteger)size {
UIFont *font = [UIFont systemFontOfSize:size];
......@@ -23,3 +23,14 @@
alpha: 1];
}
@end
@implementation UIView (GMAdditions)
- (MASViewAttribute *)mas_safeBottom {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")) {
return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
} else {
return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottom];
}
}
@end
......@@ -44,7 +44,7 @@
make.right.mas_equalTo(0);
make.height.offset(1/[UIScreen mainScreen].scale);
}];
_itemView = [[UIView alloc] initWithFrame:CGRectMake(0, 20, [UIScreen mainScreen].bounds.size.width, 44)];
_itemView = [[UIView alloc] initWithFrame:CGRectMake(0, [UIApplication sharedApplication].statusBarFrame.size.height, [UIScreen mainScreen].bounds.size.width, 44)];
CGFloat titleW = [UIScreen mainScreen].bounds.size.width - 80;
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 0, titleW, 44)];
_titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
......
......@@ -11,6 +11,8 @@
#import <GMRefresh/GMRefreshHeader.h>
#import <Masonry/Masonry.h>
@import GMHud;
#import <Availability.h>
#import "GMBaseUtil.h"
@interface WMBaseListViewController ()
......@@ -56,8 +58,8 @@
[_table mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.view.mas_left);
make.right.equalTo(self.view.mas_right);
make.top.mas_equalTo(64);
make.bottom.mas_equalTo(0);
make.top.mas_equalTo([UIApplication sharedApplication].statusBarFrame.size.height + 44);
make.bottom.equalTo(self.view.mas_safeBottom);
}];
__weak __typeof(self)weakSelf = self;
......
......@@ -72,7 +72,7 @@
[_emptyView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(0);
make.right.mas_equalTo(0);
make.top.mas_equalTo(0);
make.top.mas_equalTo([UIApplication sharedApplication].statusBarFrame.size.height);
make.bottom.mas_equalTo(0);
}];
}
......@@ -116,7 +116,7 @@
#pragma mark - 导航
- (void)customNavigationBar {
_navigationBar = [[OCNavigatioinBar alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 64)];
_navigationBar = [[OCNavigatioinBar alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIApplication sharedApplication].statusBarFrame.size.height + 44)];
}
- (void)addNavigationBar {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment