From b0ce6aa26a53bc19895976c0c36de4825d1015d4 Mon Sep 17 00:00:00 2001 From: phongnv Date: Sat, 18 Nov 2017 14:12:54 +0700 Subject: [PATCH] fix bug gui iphone x --- LifeLog/LifeLog/HistoryViewController.m | 1 + LifeLog/LifeLog/HistoryViewController.xib | 7 ++++--- LifeLog/LifeLog/HomeViewConb troller.m | 6 +++++- LifeLog/LifeLog/HomeViewController.xib | 2 +- LifeLog/LifeLog/Info.plist | 2 +- LifeLog/LifeLog/MapViewController.m | 2 ++ LifeLog/LifeLog/MapViewController.xib | 8 +++++--- LifeLog/LifeLog/RankingViewController.m | 1 + LifeLog/LifeLog/RankingViewController.xib | 7 ++++--- LifeLog/LifeLog/ServerAPI.m | 3 +-- 10 files changed, 25 insertions(+), 14 deletions(-) diff --git a/LifeLog/LifeLog/HistoryViewController.m b/LifeLog/LifeLog/HistoryViewController.m index 92ca1f0..b1edb6b 100644 --- a/LifeLog/LifeLog/HistoryViewController.m +++ b/LifeLog/LifeLog/HistoryViewController.m @@ -20,6 +20,7 @@ - (void)viewDidLoad { [super viewDidLoad]; + [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.bottomLayoutGuide attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.viewCollectionMode attribute:NSLayoutAttributeBottom multiplier:1 constant:0]]; // Do any additional setup after loading the view from its nib. self.title = NSLocalizedString(@"lifelog.history.title", nil); diff --git a/LifeLog/LifeLog/HistoryViewController.xib b/LifeLog/LifeLog/HistoryViewController.xib index aad0ce8..6c465f1 100644 --- a/LifeLog/LifeLog/HistoryViewController.xib +++ b/LifeLog/LifeLog/HistoryViewController.xib @@ -1,10 +1,11 @@ - + - + + @@ -477,7 +478,7 @@ - + diff --git a/LifeLog/LifeLog/HomeViewConb troller.m b/LifeLog/LifeLog/HomeViewConb troller.m index a0b9c4d..aa5cea2 100644 --- a/LifeLog/LifeLog/HomeViewConb troller.m +++ b/LifeLog/LifeLog/HomeViewConb troller.m @@ -57,6 +57,7 @@ static NSInteger numberTotal = 10000; self.lblTitle.text = NSLocalizedString(@"lifelog.home.title", nil); [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.topLayoutGuide attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.lblTitle attribute:NSLayoutAttributeTop multiplier:1 constant:0]]; + [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.bottomLayoutGuide attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.segmentHome attribute:NSLayoutAttributeBottom multiplier:1 constant:20]]; self.avatar.backgroundColor = [UIColor whiteColor]; self.avatar.layer.borderWidth = 2.0f; @@ -282,7 +283,7 @@ static NSInteger numberTotal = 10000; #pragma mark - Functions Private - (void)saveStepForDay:(NSDate *)date { - if ([CMMotionActivityManager isActivityAvailable]) { + if ([CMMotionActivityManager isActivityAvailable] == YES) { [progressHud showAnimated:YES]; [progressHud setHidden:NO]; self.bike = 0; @@ -327,6 +328,9 @@ static NSInteger numberTotal = 10000; }]; }); } + else { + [self updateStepUI]; + } } - (void)complete20Request:(NSArray *)activities { diff --git a/LifeLog/LifeLog/HomeViewController.xib b/LifeLog/LifeLog/HomeViewController.xib index 92b775a..4dc5936 100644 --- a/LifeLog/LifeLog/HomeViewController.xib +++ b/LifeLog/LifeLog/HomeViewController.xib @@ -200,7 +200,7 @@ - + diff --git a/LifeLog/LifeLog/Info.plist b/LifeLog/LifeLog/Info.plist index a88ebcd..c2847d8 100644 --- a/LifeLog/LifeLog/Info.plist +++ b/LifeLog/LifeLog/Info.plist @@ -23,7 +23,7 @@ CFBundleVersion - 5 + 7 LSApplicationQueriesSchemes line diff --git a/LifeLog/LifeLog/MapViewController.m b/LifeLog/LifeLog/MapViewController.m index 46f3f98..e881b2b 100644 --- a/LifeLog/LifeLog/MapViewController.m +++ b/LifeLog/LifeLog/MapViewController.m @@ -25,6 +25,7 @@ @property (nonatomic, weak) IBOutlet UILabel *lblValueStep; @property (nonatomic, weak) IBOutlet UILabel *lblUnitStep; +@property (weak, nonatomic) IBOutlet UIView *viewOther; @property (strong, nonatomic) CLLocationManager *locationManager; @@ -43,6 +44,7 @@ // Do any additional setup after loading the view from its nib. self.title = NSLocalizedString(@"lifelog.tapbar.map", nil); [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.topLayoutGuide attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.mapView attribute:NSLayoutAttributeTop multiplier:1 constant:0]]; + [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.bottomLayoutGuide attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.mapView attribute:NSLayoutAttributeBottom multiplier:1 constant:44]]; geocoder = [[CLGeocoder alloc] init]; [self setupLocation]; [self setupMapView]; diff --git a/LifeLog/LifeLog/MapViewController.xib b/LifeLog/LifeLog/MapViewController.xib index 417d257..e3e6dc7 100644 --- a/LifeLog/LifeLog/MapViewController.xib +++ b/LifeLog/LifeLog/MapViewController.xib @@ -1,10 +1,11 @@ - + - + + @@ -16,6 +17,7 @@ + @@ -91,7 +93,7 @@ - + diff --git a/LifeLog/LifeLog/RankingViewController.m b/LifeLog/LifeLog/RankingViewController.m index 796414f..313ce37 100644 --- a/LifeLog/LifeLog/RankingViewController.m +++ b/LifeLog/LifeLog/RankingViewController.m @@ -20,6 +20,7 @@ - (void)viewDidLoad { [super viewDidLoad]; + [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.bottomLayoutGuide attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.viewCollectionType attribute:NSLayoutAttributeBottom multiplier:1 constant:5]]; // Do any additional setup after loading the view from its nib. self.title = NSLocalizedString(@"lifelog.rank.title", nil); diff --git a/LifeLog/LifeLog/RankingViewController.xib b/LifeLog/LifeLog/RankingViewController.xib index f36fbeb..8806dc9 100644 --- a/LifeLog/LifeLog/RankingViewController.xib +++ b/LifeLog/LifeLog/RankingViewController.xib @@ -1,10 +1,11 @@ - + - + + @@ -159,7 +160,7 @@ MjAxNuW5tCAx5pyIMjLml6XjgIDvvI3jgIAyMDE35bm0IDHmnIgyMeaXpQ0KAA - + diff --git a/LifeLog/LifeLog/ServerAPI.m b/LifeLog/LifeLog/ServerAPI.m index d6ade05..3f9471e 100644 --- a/LifeLog/LifeLog/ServerAPI.m +++ b/LifeLog/LifeLog/ServerAPI.m @@ -1191,7 +1191,7 @@ NSURLSessionDataTask * searchTask; for (id key in dictionary) { NSString *encodedValue = [[dictionary[key] description] urlencode]; - NSString *encodedKey = [[key description] urlencode];//[[key description] stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; + NSString *encodedKey = [[key description] stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];//[[key description] urlencode]; NSString *part = [NSString stringWithFormat: @"%@=%@", encodedKey, encodedValue]; [parts addObject:part]; } @@ -1213,7 +1213,6 @@ NSURLSessionDataTask * searchTask; if (paras != nil) { NSData *encodedData = [self _encodeDictionary: paras]; - [request setValue: [NSString stringWithFormat: @"%lu", (unsigned long) encodedData.length] forHTTPHeaderField: @"Content-Length"]; [request setValue: @"application/x-www-form-urlencoded charset=utf-8" forHTTPHeaderField: @"Content-Type"]; [request setHTTPBody: encodedData]; } -- 1.8.5.3