fix 中文乱码

This commit is contained in:
lianxiang 2018-09-08 12:47:27 +08:00
parent fdee3e47f4
commit 7685ce516e
3 changed files with 10 additions and 9 deletions

View File

@ -228,9 +228,9 @@
if (jsonString == nil) {
return nil;
}
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
// 13.2.0 isoLatin1
//NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
NSData *jsonData = [jsonString dataUsingEncoding:NSISOLatin1StringEncoding];
NSError *err;
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData
options:NSJSONReadingMutableContainers

View File

@ -268,6 +268,7 @@
[self.faceView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(91 + PhoneX_TopMargin);
make.size.mas_equalTo(CGSizeMake(99, 124));
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
@ -282,21 +283,21 @@
//up
[self.swipeGaurdimagView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(368);
make.top.mas_equalTo(self.view.mas_top).offset(368 + PhoneX_TopMargin);
make.width.and.height.mas_equalTo(20);
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
//startMask
[self.startMaskButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(412);
make.top.mas_equalTo(self.view.mas_top).offset(412 + PhoneX_TopMargin);
make.size.mas_equalTo(CGSizeMake(117, 25));
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
//startTest
[self.startTestButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view.mas_top).offset(486);
make.top.mas_equalTo(self.view.mas_top).offset(486 + PhoneX_TopMargin);
make.size.mas_equalTo(CGSizeMake(132, 41));
make.centerX.mas_equalTo(self.view.mas_centerX);
}];
@ -532,7 +533,7 @@
[self.view addSubview:self.waringView];
[UIView animateWithDuration:0.4 animations:^{
self.waringView.frame = CGRectMake(0,CGRectGetMaxY(self.view.frame) - 60, self.view.frame.size.width, 60);
self.waringView.frame = CGRectMake(0,CGRectGetMaxY(self.view.frame) - 60 - PhoneX_BottomMargin, self.view.frame.size.width, 60);
}];
[self.waringView showView];
}

View File

@ -34,7 +34,7 @@ static const CGFloat kInputViewH = 44.f;
-(void)creatInputView{
UIView *commitView =[[UIView alloc] initWithFrame:CGRectMake(0, self.bounds.size.height - kInputViewH, self.bounds.size.width, kInputViewH)];
UIView *commitView =[[UIView alloc] initWithFrame:CGRectMake(0, self.bounds.size.height - kInputViewH - PhoneX_BottomMargin, self.bounds.size.width, kInputViewH)];
self.commitInputView = commitView;
self.commitInputView.backgroundColor = GIGARGB(241, 241, 241, 1);
@ -170,7 +170,7 @@ static const CGFloat kInputViewH = 44.f;
- (void) keyboardWillHide:(NSNotification *)note
{
self.commitInputView.frame = CGRectMake(0, self.bounds.size.height - kInputViewH, self.bounds.size.width, kInputViewH);
self.commitInputView.frame = CGRectMake(0, self.bounds.size.height - kInputViewH - PhoneX_BottomMargin, self.bounds.size.width, kInputViewH);
}
- (void)dealloc