fix
This commit is contained in:
@@ -24,8 +24,7 @@
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
|
||||
[self.navigationController.navigationBar cnSetBackgroundColor:GIGARGB(216, 216, 216, 1)];
|
||||
//[self.navigationController.navigationBar cnSetBackgroundColor:GIGARGB(216, 216, 216, 1)];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -53,5 +53,10 @@
|
||||
*/
|
||||
+(BOOL)isPhoneNumber:(NSString*)mobileNumber;
|
||||
|
||||
+(NSAttributedString *)stringWithText:(NSString *)title textColor:(UIColor *)color textFont:(UIFont *)font leterSpace:(CGFloat )space;
|
||||
|
||||
+(NSString *)convertToJsonData:(NSDictionary *)dict;
|
||||
+(NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -171,7 +171,76 @@
|
||||
return NO;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+(NSAttributedString *)stringWithText:(NSString *)title textColor:(UIColor *)color textFont:(UIFont *)font leterSpace:(CGFloat )space
|
||||
{
|
||||
NSMutableParagraphStyle *paragraStyle = [[NSMutableParagraphStyle alloc] init];
|
||||
paragraStyle.alignment = NSTextAlignmentCenter;
|
||||
|
||||
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:font,NSForegroundColorAttributeName:color,NSKernAttributeName:@(space),NSParagraphStyleAttributeName:paragraStyle}];
|
||||
|
||||
return attributedString;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+(NSString *)convertToJsonData:(NSDictionary *)dict
|
||||
|
||||
{
|
||||
|
||||
NSError *error;
|
||||
|
||||
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:&error];
|
||||
|
||||
NSString *jsonString;
|
||||
|
||||
if (!jsonData) {
|
||||
|
||||
NSLog(@"%@",error);
|
||||
|
||||
}else{
|
||||
|
||||
jsonString = [[NSString alloc]initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||
|
||||
}
|
||||
|
||||
NSMutableString *mutStr = [NSMutableString stringWithString:jsonString];
|
||||
|
||||
NSRange range = {0,jsonString.length};
|
||||
|
||||
//去掉字符串中的空格
|
||||
|
||||
[mutStr replaceOccurrencesOfString:@" " withString:@"" options:NSLiteralSearch range:range];
|
||||
|
||||
NSRange range2 = {0,mutStr.length};
|
||||
|
||||
//去掉字符串中的换行符
|
||||
|
||||
[mutStr replaceOccurrencesOfString:@"\n" withString:@"" options:NSLiteralSearch range:range2];
|
||||
|
||||
return mutStr;
|
||||
|
||||
}
|
||||
|
||||
+(NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString
|
||||
{
|
||||
if (jsonString == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
|
||||
|
||||
NSError *err;
|
||||
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData
|
||||
options:NSJSONReadingMutableContainers
|
||||
error:&err];
|
||||
if(err)
|
||||
{
|
||||
NSLog(@"json解析失败:%@",err);
|
||||
return nil;
|
||||
}
|
||||
return dic;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
{
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 44)];
|
||||
//label.textColor = GIGAUIColorFromRGBA(0x777777);
|
||||
label.textColor = [UIColor whiteColor];
|
||||
label.text = str;
|
||||
label.font = [UIFont fontWithName:@"PingFangSC-Medium" size:18.f];
|
||||
|
||||
Reference in New Issue
Block a user