|
@@ -252,16 +252,18 @@
|
|
|
{
|
|
{
|
|
|
[super viewWillAppear:animated];
|
|
[super viewWillAppear:animated];
|
|
|
|
|
|
|
|
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
|
|
|
|
|
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
|
|
|
|
|
|
|
+// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
|
|
|
|
|
+// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
|
|
|
|
|
|
|
|
// 键盘高度变化通知,ios5.0新增的
|
|
// 键盘高度变化通知,ios5.0新增的
|
|
|
-#ifdef __IPHONE_5_0
|
|
|
|
|
- float version = [[[UIDevice currentDevice] systemVersion] floatValue];
|
|
|
|
|
- if (version >= 5.0) {
|
|
|
|
|
|
|
+//#ifdef __IPHONE_5_0
|
|
|
|
|
+// float version = [[[UIDevice currentDevice] systemVersion] floatValue];
|
|
|
|
|
+// if (version >= 5.0) {
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
|
|
|
- }
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidChangeFrame:) name:UIKeyboardDidChangeFrameNotification object:nil];
|
|
|
|
|
+
|
|
|
|
|
+// }
|
|
|
|
|
+//#endif
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-(void) viewWillDisappear:(BOOL)animated
|
|
-(void) viewWillDisappear:(BOOL)animated
|
|
@@ -402,50 +404,52 @@
|
|
|
if(self.url_type==URL_REMOTE)
|
|
if(self.url_type==URL_REMOTE)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
- UIAlertController * waitalert = [RAUtils waiting_alert:self message:self.loading_msg title:self.loading_title];
|
|
|
|
|
-
|
|
|
|
|
- [RANetwork request_editor:self.request_url params:self.params completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
- NSMutableDictionary* editor_json = result;
|
|
|
|
|
- DebugLog(@"data string: %@",[RAConvertor dict2string:editor_json] );
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ __block UIAlertController * waitalert = [RAUtils waiting_alert:self message:self.loading_msg title:self.loading_title completion:^{
|
|
|
|
|
+ [RANetwork request_editor:self.request_url params:self.params completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
+ NSMutableDictionary* editor_json = result;
|
|
|
|
|
+ DebugLog(@"data string: %@",[RAConvertor dict2string:editor_json] );
|
|
|
|
|
+
|
|
|
|
|
|
|
|
- [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
- if([[editor_json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- weakself.content_data_download = [editor_json mutableCopy];
|
|
|
|
|
-
|
|
|
|
|
- weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed: weakself.changed_data];
|
|
|
|
|
-
|
|
|
|
|
- // self.content_data = [editor_json mutableCopy];
|
|
|
|
|
- // self.content_data = [self translate_json:editor_json];
|
|
|
|
|
-
|
|
|
|
|
- // NSMutableDictionary* content_data1 = [self translate_json:self.content_data];
|
|
|
|
|
|
|
|
|
|
- [weakself download_success];
|
|
|
|
|
|
|
+ [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
+ if([[editor_json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ weakself.content_data_download = [editor_json mutableCopy];
|
|
|
|
|
+
|
|
|
|
|
+ weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed: weakself.changed_data];
|
|
|
|
|
+
|
|
|
|
|
+ // self.content_data = [editor_json mutableCopy];
|
|
|
|
|
+ // self.content_data = [self translate_json:editor_json];
|
|
|
|
|
+
|
|
|
|
|
+ // NSMutableDictionary* content_data1 = [self translate_json:self.content_data];
|
|
|
|
|
+
|
|
|
|
|
+ [weakself download_success];
|
|
|
|
|
+
|
|
|
|
|
+ [weakself.editorTable reloadData];
|
|
|
|
|
+
|
|
|
|
|
+ // NSString * ttt=[self.content_data valueForKey:@"title"] ;
|
|
|
|
|
+
|
|
|
|
|
+ weakself.navigationItem.title = [weakself.content_data_download valueForKey:@"title"] ;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ [weakself download_failed];
|
|
|
|
|
+ [weakself alertMessage:[editor_json valueForKey:@"err_msg"]];
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }];
|
|
|
|
|
|
|
|
- [weakself.editorTable reloadData];
|
|
|
|
|
|
|
|
|
|
- // NSString * ttt=[self.content_data valueForKey:@"title"] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
- weakself.navigationItem.title = [weakself.content_data_download valueForKey:@"title"] ;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- [weakself download_failed];
|
|
|
|
|
- [weakself alertMessage:[editor_json valueForKey:@"err_msg"]];
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
- }];
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
+ }];
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
}];
|
|
}];
|
|
|
|
|
|
|
|
|
|
+
|
|
|
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
//
|
|
//
|
|
|
// NSDictionary* editor_json = [weakself request_Editor:weakself.request_url params:weakself.params];
|
|
// NSDictionary* editor_json = [weakself request_Editor:weakself.request_url params:weakself.params];
|
|
@@ -1365,56 +1369,58 @@
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- UIAlertController * waitalert = [RAUtils waiting_alert:self message:self.loading_msg title:self.loading_title];
|
|
|
|
|
-
|
|
|
|
|
self.params[@"refresh_trigger"]=trigger;
|
|
self.params[@"refresh_trigger"]=trigger;
|
|
|
- __weak typeof(self) weakself = self;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- NSDictionary* refresh_params=[self get_refresh_param];
|
|
|
|
|
-
|
|
|
|
|
- NSArray* changed_key=[refresh_params allKeys];
|
|
|
|
|
- for(int i=0;i<changed_key.count;i++)
|
|
|
|
|
- {
|
|
|
|
|
- NSString* obj_str=[NSString stringWithFormat:@"%@",[refresh_params valueForKey:(NSString*)changed_key[i]]];
|
|
|
|
|
- [self.params setObject:obj_str forKey:(NSString*)changed_key[i]];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- [RANetwork request_editor:self.request_url params:self.params completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
- NSMutableDictionary* editor_json = result;
|
|
|
|
|
- DebugLog(@"data string: %@",[RAConvertor dict2string:editor_json] );
|
|
|
|
|
-
|
|
|
|
|
- [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
- if([[editor_json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ __weak typeof(self) weakself = self;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSDictionary* refresh_params=[self get_refresh_param];
|
|
|
|
|
+
|
|
|
|
|
+ NSArray* changed_key=[refresh_params allKeys];
|
|
|
|
|
+ for(int i=0;i<changed_key.count;i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSString* obj_str=[NSString stringWithFormat:@"%@",[refresh_params valueForKey:(NSString*)changed_key[i]]];
|
|
|
|
|
+ [self.params setObject:obj_str forKey:(NSString*)changed_key[i]];
|
|
|
|
|
+ }
|
|
|
|
|
+ __block UIAlertController * waitalert = [RAUtils waiting_alert:self message:self.loading_msg title:self.loading_title completion:^{
|
|
|
|
|
+ [RANetwork request_editor:self.request_url params:self.params completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
+ NSMutableDictionary* editor_json = result;
|
|
|
|
|
+ DebugLog(@"data string: %@",[RAConvertor dict2string:editor_json] );
|
|
|
|
|
+
|
|
|
|
|
+ [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
+ if([[editor_json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ weakself.content_data_download = [weakself CopyDirty:weakself.content_data_download to:[editor_json mutableCopy]];//[editor_json mutableCopy];
|
|
|
|
|
+
|
|
|
|
|
+ weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed: weakself.changed_data];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [weakself download_success];
|
|
|
|
|
+ [weakself.editorTable reloadData];
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ [weakself download_failed];
|
|
|
|
|
+ [weakself alertMessage:[editor_json valueForKey:@"err_msg"]];
|
|
|
|
|
+ }
|
|
|
|
|
+ }];
|
|
|
|
|
|
|
|
- weakself.content_data_download = [weakself CopyDirty:weakself.content_data_download to:[editor_json mutableCopy]];//[editor_json mutableCopy];
|
|
|
|
|
|
|
|
|
|
- weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed: weakself.changed_data];
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
- [weakself download_success];
|
|
|
|
|
- [weakself.editorTable reloadData];
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- [weakself download_failed];
|
|
|
|
|
- [weakself alertMessage:[editor_json valueForKey:@"err_msg"]];
|
|
|
|
|
- }
|
|
|
|
|
- }];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
+ }];
|
|
|
|
|
|
|
|
|
|
+
|
|
|
}];
|
|
}];
|
|
|
|
|
|
|
|
-// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
//
|
|
//
|
|
|
//
|
|
//
|
|
|
//
|
|
//
|
|
@@ -2617,40 +2623,42 @@
|
|
|
|
|
|
|
|
[params setValue:val forKey:name];
|
|
[params setValue:val forKey:name];
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- UIAlertController * waitalert = [RAUtils waiting_alert:self message:self.loading_msg title:self.loading_title];
|
|
|
|
|
__weak typeof(self) weakself = self;
|
|
__weak typeof(self) weakself = self;
|
|
|
-
|
|
|
|
|
- [RANetwork request_commoneditor_partialrefresh:params url:url completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
- NSDictionary* editor_json =result;
|
|
|
|
|
- [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
- if([[editor_json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- int prcount = [[editor_json valueForKey:@"count"] intValue];
|
|
|
|
|
- for(int ipr=0;ipr<prcount;ipr++)
|
|
|
|
|
|
|
+ __block UIAlertController * waitalert = [RAUtils waiting_alert:self message:self.loading_msg title:self.loading_title completion:^{
|
|
|
|
|
+ [RANetwork request_commoneditor_partialrefresh:params url:url completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
+ NSDictionary* editor_json =result;
|
|
|
|
|
+ [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
+ if([[editor_json valueForKey:@"result"] intValue]==2)
|
|
|
{
|
|
{
|
|
|
- NSDictionary* pr_item = [editor_json objectForKey:[NSString stringWithFormat:@"item_%d",ipr]];
|
|
|
|
|
- NSString* name = [pr_item valueForKey:@"name"];
|
|
|
|
|
- NSString* value = [pr_item valueForKey:@"value"];
|
|
|
|
|
|
|
|
|
|
- [weakself setValue:name value:value];
|
|
|
|
|
|
|
+ int prcount = [[editor_json valueForKey:@"count"] intValue];
|
|
|
|
|
+ for(int ipr=0;ipr<prcount;ipr++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSDictionary* pr_item = [editor_json objectForKey:[NSString stringWithFormat:@"item_%d",ipr]];
|
|
|
|
|
+ NSString* name = [pr_item valueForKey:@"name"];
|
|
|
|
|
+ NSString* value = [pr_item valueForKey:@"value"];
|
|
|
|
|
+
|
|
|
|
|
+ [weakself setValue:name value:value];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:nil controller:weakself] ;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:nil controller:weakself] ;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}];
|
|
}];
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
}];
|
|
}];
|
|
|
-// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
//
|
|
//
|
|
|
// NSDictionary* editor_json = [RANetwork commoneditor_partialrefresh:params url:url];
|
|
// NSDictionary* editor_json = [RANetwork commoneditor_partialrefresh:params url:url];
|
|
|
//
|
|
//
|
|
@@ -2767,39 +2775,42 @@
|
|
|
|
|
|
|
|
[params setValue:val forKey:name];
|
|
[params setValue:val forKey:name];
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- UIAlertController * waitalert = [RAUtils waiting_alert:self message:self.loading_msg title:self.loading_title];
|
|
|
|
|
__weak typeof(self) weakself = self;
|
|
__weak typeof(self) weakself = self;
|
|
|
|
|
|
|
|
- [RANetwork request_commoneditor_partialrefresh:params url:url completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
- NSDictionary* editor_json = result;
|
|
|
|
|
- [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
- if([[editor_json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- int prcount = [[editor_json valueForKey:@"count"] intValue];
|
|
|
|
|
- for(int ipr=0;ipr<prcount;ipr++)
|
|
|
|
|
|
|
+ __block UIAlertController * waitalert = [RAUtils waiting_alert:self message:self.loading_msg title:self.loading_title completion:^{
|
|
|
|
|
+ [RANetwork request_commoneditor_partialrefresh:params url:url completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
+ NSDictionary* editor_json = result;
|
|
|
|
|
+ [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
+ if([[editor_json valueForKey:@"result"] intValue]==2)
|
|
|
{
|
|
{
|
|
|
- NSDictionary* pr_item = [editor_json objectForKey:[NSString stringWithFormat:@"item_%d",ipr]];
|
|
|
|
|
- NSString* name = [pr_item valueForKey:@"name"];
|
|
|
|
|
- NSString* value = [pr_item valueForKey:@"value"];
|
|
|
|
|
|
|
|
|
|
- [weakself setValue:name value:value];
|
|
|
|
|
|
|
+ int prcount = [[editor_json valueForKey:@"count"] intValue];
|
|
|
|
|
+ for(int ipr=0;ipr<prcount;ipr++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSDictionary* pr_item = [editor_json objectForKey:[NSString stringWithFormat:@"item_%d",ipr]];
|
|
|
|
|
+ NSString* name = [pr_item valueForKey:@"name"];
|
|
|
|
|
+ NSString* value = [pr_item valueForKey:@"value"];
|
|
|
|
|
+
|
|
|
|
|
+ [weakself setValue:name value:value];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:nil controller:weakself] ;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:nil controller:weakself] ;
|
|
|
|
|
+ }
|
|
|
|
|
+ }];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}];
|
|
}];
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
}];
|
|
}];
|
|
|
-// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
//
|
|
//
|
|
|
// NSDictionary* editor_json = [RANetwork commoneditor_partialrefresh:params url:url];
|
|
// NSDictionary* editor_json = [RANetwork commoneditor_partialrefresh:params url:url];
|
|
|
//
|
|
//
|
|
@@ -3276,6 +3287,7 @@
|
|
|
NSMutableString* title = [[item_json valueForKey:@"aname"] mutableCopy];
|
|
NSMutableString* title = [[item_json valueForKey:@"aname"] mutableCopy];
|
|
|
NSString* value =[item_json valueForKey:@"value"];
|
|
NSString* value =[item_json valueForKey:@"value"];
|
|
|
NSString* align =[item_json valueForKey:@"align"];
|
|
NSString* align =[item_json valueForKey:@"align"];
|
|
|
|
|
+
|
|
|
if([align isEqualToString:@"right"])
|
|
if([align isEqualToString:@"right"])
|
|
|
cell.textview.textAlignment= kCTTextAlignmentRight;
|
|
cell.textview.textAlignment= kCTTextAlignmentRight;
|
|
|
else
|
|
else
|
|
@@ -4957,48 +4969,50 @@
|
|
|
if(password!=nil)
|
|
if(password!=nil)
|
|
|
[params setValue:password forKey:@"password"];
|
|
[params setValue:password forKey:@"password"];
|
|
|
|
|
|
|
|
- UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Upload Signature"];
|
|
|
|
|
-
|
|
|
|
|
- [NetworkUtils upload:imageData FileName:@"test.jpg" Params:params ToHost:URL_UPLOAD_IMG Result:^(NSMutableDictionary *json) {
|
|
|
|
|
-
|
|
|
|
|
- dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
- [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
- if([[json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
- {
|
|
|
|
|
- NSString* img_url_down = json[@"img_url_aname"];
|
|
|
|
|
-
|
|
|
|
|
- NSString* img_url_up = json[@"img_url"];
|
|
|
|
|
-
|
|
|
|
|
- NSMutableDictionary* item_json =((NSMutableArray*)weakself.content_data_control[indexPath.section])[indexPath.row];
|
|
|
|
|
-
|
|
|
|
|
- [item_json setValue:img_url_down forKey:@"avalue"];
|
|
|
|
|
- [item_json setValue:img_url_up forKey:@"value"];
|
|
|
|
|
- [item_json setValue:@"true" forKey:@"dirty"];
|
|
|
|
|
- NSMutableDictionary* section_json = [[weakself.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]] mutableCopy];
|
|
|
|
|
- [section_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%ld",indexPath.row]];
|
|
|
|
|
-
|
|
|
|
|
- [weakself.content_data_download setObject:section_json forKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]];
|
|
|
|
|
- weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed:weakself.changed_data];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- CommonEditorCellSignature* cell = (CommonEditorCellSignature*) [weakself.editorTable cellForRowAtIndexPath:indexPath];
|
|
|
|
|
-
|
|
|
|
|
- cell.imageviewSignature.image = signimg;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- [RAUtils message_alert:[json valueForKey:@"err_msg"] title:@"Upload Image" controller:weakself] ;
|
|
|
|
|
- }
|
|
|
|
|
- }];
|
|
|
|
|
|
|
+ __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Upload Signature" completion:^{
|
|
|
|
|
+ [NetworkUtils upload:imageData FileName:@"test.jpg" Params:params ToHost:URL_UPLOAD_IMG Result:^(NSMutableDictionary *json) {
|
|
|
|
|
|
|
|
|
|
+// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
+ [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
+ if([[json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSString* img_url_down = json[@"img_url_aname"];
|
|
|
|
|
|
|
|
|
|
+ NSString* img_url_up = json[@"img_url"];
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary* item_json =((NSMutableArray*)weakself.content_data_control[indexPath.section])[indexPath.row];
|
|
|
|
|
+
|
|
|
|
|
+ [item_json setValue:img_url_down forKey:@"avalue"];
|
|
|
|
|
+ [item_json setValue:img_url_up forKey:@"value"];
|
|
|
|
|
+ [item_json setValue:@"true" forKey:@"dirty"];
|
|
|
|
|
+ NSMutableDictionary* section_json = [[weakself.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]] mutableCopy];
|
|
|
|
|
+ [section_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%ld",indexPath.row]];
|
|
|
|
|
+
|
|
|
|
|
+ [weakself.content_data_download setObject:section_json forKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]];
|
|
|
|
|
+ weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed:weakself.changed_data];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ CommonEditorCellSignature* cell = (CommonEditorCellSignature*) [weakself.editorTable cellForRowAtIndexPath:indexPath];
|
|
|
|
|
+
|
|
|
|
|
+ cell.imageviewSignature.image = signimg;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ [RAUtils message_alert:[json valueForKey:@"err_msg"] title:@"Upload Image" controller:weakself] ;
|
|
|
|
|
+ }
|
|
|
|
|
+ }];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// });
|
|
|
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- } Progress:nil DecryptHandler:nil];
|
|
|
|
|
|
|
+ } Progress:nil DecryptHandler:nil];
|
|
|
|
|
+
|
|
|
|
|
+ }];
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
// AFHTTPRequestSerializer* serializer=[AFHTTPRequestSerializer serializer] ;
|
|
// AFHTTPRequestSerializer* serializer=[AFHTTPRequestSerializer serializer] ;
|
|
@@ -5992,7 +6006,7 @@
|
|
|
|
|
|
|
|
- (void)textFieldDidBeginEditing:(UITextField *)textField
|
|
- (void)textFieldDidBeginEditing:(UITextField *)textField
|
|
|
{
|
|
{
|
|
|
- DebugLog(@"textField shouldChangeCharactersInRange");
|
|
|
|
|
|
|
+ DebugLog(@"textField textFieldDidBeginEditing");
|
|
|
|
|
|
|
|
self.lastedit = textField;
|
|
self.lastedit = textField;
|
|
|
UITableViewCell *cell = (UITableViewCell *) textField.superview.superview;
|
|
UITableViewCell *cell = (UITableViewCell *) textField.superview.superview;
|
|
@@ -6405,10 +6419,47 @@
|
|
|
//{
|
|
//{
|
|
|
// return [RANetwork request_Editor:request_url params:params];
|
|
// return [RANetwork request_Editor:request_url params:params];
|
|
|
//}
|
|
//}
|
|
|
|
|
+//
|
|
|
|
|
+//- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
|
|
|
|
|
+//{
|
|
|
|
|
+//
|
|
|
|
|
+// NSLog(@"willDisplayCell");
|
|
|
|
|
+// NSString *cellclass;
|
|
|
|
|
+// const char *class_name_ch = object_getClassName([cell class]);
|
|
|
|
|
+// cellclass = [NSString stringWithUTF8String:class_name_ch];
|
|
|
|
|
+//
|
|
|
|
|
+// CommonEditorCellTextView * tvcell=nil;
|
|
|
|
|
+// if([cellclass isEqualToString:@"CommonEditorCellTextView"])
|
|
|
|
|
+// {
|
|
|
|
|
+// tvcell=(CommonEditorCellTextView*)self.editingcell;
|
|
|
|
|
+// tvcell.textview.scrollEnabled=true;
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+//}
|
|
|
|
|
+//- (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath*)indexPath
|
|
|
|
|
+//{
|
|
|
|
|
+//
|
|
|
|
|
+// NSLog(@"didEndDisplayingCell");
|
|
|
|
|
+// NSString *cellclass;
|
|
|
|
|
+// const char *class_name_ch = object_getClassName([cell class]);
|
|
|
|
|
+// cellclass = [NSString stringWithUTF8String:class_name_ch];
|
|
|
|
|
+//
|
|
|
|
|
+// CommonEditorCellTextView * tvcell=nil;
|
|
|
|
|
+// if([cellclass isEqualToString:@"CommonEditorCellTextView"])
|
|
|
|
|
+// {
|
|
|
|
|
+// tvcell=(CommonEditorCellTextView*)self.editingcell;
|
|
|
|
|
+// tvcell.textview.scrollEnabled=false;
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+//}
|
|
|
#pragma mark - Responding to keyboard events
|
|
#pragma mark - Responding to keyboard events
|
|
|
|
|
|
|
|
|
|
|
|
|
- (void)keyboardWillChangeFrame:(NSNotification *)notification {
|
|
- (void)keyboardWillChangeFrame:(NSNotification *)notification {
|
|
|
|
|
+// return;
|
|
|
DebugLog(@"keyboardWillChangeFrame");
|
|
DebugLog(@"keyboardWillChangeFrame");
|
|
|
|
|
|
|
|
|
|
|
|
@@ -6432,17 +6483,42 @@
|
|
|
|
|
|
|
|
// table -> top > offset: table.y = -offset
|
|
// table -> top > offset: table.y = -offset
|
|
|
// 事实上top:topLayoutGuide
|
|
// 事实上top:topLayoutGuide
|
|
|
|
|
+// self.additionalSafeAreaInsets
|
|
|
|
|
+
|
|
|
float y0=self.view.safeAreaLayoutGuide.topAnchor.accessibilityActivationPoint.y;
|
|
float y0=self.view.safeAreaLayoutGuide.topAnchor.accessibilityActivationPoint.y;
|
|
|
- CGFloat topAvailableHeight = (CGRectGetMinY(table_origin_screen_frame) - self.topLayoutGuide.length);
|
|
|
|
|
|
|
+ CGFloat topAvailableHeight = (CGRectGetMinY(table_origin_screen_frame) - y0);
|
|
|
if (topAvailableHeight > 0) {
|
|
if (topAvailableHeight > 0) {
|
|
|
if (topAvailableHeight > offset) {
|
|
if (topAvailableHeight > offset) {
|
|
|
table_frame.origin.y = -offset;
|
|
table_frame.origin.y = -offset;
|
|
|
} else {
|
|
} else {
|
|
|
// 向上移动到topLayoutGuide,不足部分通过缩减高度到达keyboard顶部
|
|
// 向上移动到topLayoutGuide,不足部分通过缩减高度到达keyboard顶部
|
|
|
- table_frame.origin.y = -topAvailableHeight;
|
|
|
|
|
|
|
+// table_frame.origin.y = -topAvailableHeight;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// table_frame.size.height = (end_y - self.topLayoutGuide.length);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ for (NSLayoutConstraint *constraint in self.tableContainer.constraints) {
|
|
|
|
|
+ if (constraint.firstAttribute == NSLayoutAttributeBottom) {
|
|
|
|
|
+// int a=0;
|
|
|
|
|
+
|
|
|
|
|
+ [self.tableContainer removeConstraint:constraint];
|
|
|
|
|
+ NSLayoutConstraint *bottom_constraint = [NSLayoutConstraint constraintWithItem:self.editorTable
|
|
|
|
|
+ attribute:NSLayoutAttributeBottom
|
|
|
|
|
+ relatedBy:NSLayoutRelationEqual
|
|
|
|
|
+ toItem:self.tableContainer
|
|
|
|
|
+ attribute:NSLayoutAttributeBottom
|
|
|
|
|
+ multiplier:1
|
|
|
|
|
+ constant:-end.size.height];
|
|
|
|
|
+ self.tb_bottom_constraint = bottom_constraint;
|
|
|
|
|
+ [self.tableContainer addConstraint:bottom_constraint];
|
|
|
|
|
+ break;
|
|
|
|
|
+ //
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
- table_frame.size.height = (end_y - self.topLayoutGuide.length);
|
|
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
// contentInset = (top = 64, left = 0, bottom = 0, right = 0),topAvailableHeight = -64
|
|
// contentInset = (top = 64, left = 0, bottom = 0, right = 0),topAvailableHeight = -64
|
|
@@ -6452,15 +6528,66 @@
|
|
|
// table_frame.size.height = CGRectGetHeight(table_origin_screen_frame) - (CGRectGetMaxY(table_origin_screen_frame) - end_y);
|
|
// table_frame.size.height = CGRectGetHeight(table_origin_screen_frame) - (CGRectGetMaxY(table_origin_screen_frame) - end_y);
|
|
|
} else {
|
|
} else {
|
|
|
// table_frame.size.height = CGRectGetHeight(table_origin_screen_frame);
|
|
// table_frame.size.height = CGRectGetHeight(table_origin_screen_frame);
|
|
|
- table_frame = self.tableContainer.bounds;
|
|
|
|
|
|
|
+// table_frame = self.tableContainer.bounds;
|
|
|
|
|
+ for (NSLayoutConstraint *constraint in self.tableContainer.constraints) {
|
|
|
|
|
+ if (constraint.firstAttribute == NSLayoutAttributeBottom) {
|
|
|
|
|
+ // int a=0;
|
|
|
|
|
+
|
|
|
|
|
+ [self.tableContainer removeConstraint:constraint];
|
|
|
|
|
+ NSLayoutConstraint *bottom_constraint = [NSLayoutConstraint constraintWithItem:self.editorTable
|
|
|
|
|
+ attribute:NSLayoutAttributeBottom
|
|
|
|
|
+ relatedBy:NSLayoutRelationEqual
|
|
|
|
|
+ toItem:self.tableContainer
|
|
|
|
|
+ attribute:NSLayoutAttributeBottom
|
|
|
|
|
+ multiplier:1
|
|
|
|
|
+ constant:0];
|
|
|
|
|
+ self.tb_bottom_constraint = bottom_constraint;
|
|
|
|
|
+ [self.tableContainer addConstraint:bottom_constraint];
|
|
|
|
|
+ break;
|
|
|
|
|
+ //
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
self.editorTable.frame = table_frame;
|
|
self.editorTable.frame = table_frame;
|
|
|
|
|
|
|
|
CGRect cell_screen_frame = [self.editingcell convertRect:self.editingcell.bounds toView:self.view.window];
|
|
CGRect cell_screen_frame = [self.editingcell convertRect:self.editingcell.bounds toView:self.view.window];
|
|
|
- if (CGRectGetMaxY(cell_screen_frame) > end_y) {
|
|
|
|
|
|
|
+ int cover =CGRectGetMaxY(cell_screen_frame) - end_y;
|
|
|
|
|
+ if (cover>0) {
|
|
|
// Cell 被键盘遮挡后才滚动
|
|
// Cell 被键盘遮挡后才滚动
|
|
|
- [self.editorTable scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionNone animated:NO];
|
|
|
|
|
|
|
+ NSLog(@"scrollToRowAtIndexPath");
|
|
|
|
|
+ NSString *cellclass;
|
|
|
|
|
+ const char *class_name_ch = object_getClassName([self.editingcell class]);
|
|
|
|
|
+ cellclass = [NSString stringWithUTF8String:class_name_ch];
|
|
|
|
|
+
|
|
|
|
|
+ CommonEditorCellTextView * tvcell=nil;
|
|
|
|
|
+// if([cellclass isEqualToString:@"CommonEditorCellTextView"])
|
|
|
|
|
+ {
|
|
|
|
|
+// tvcell=(CommonEditorCellTextView*)self.editingcell;
|
|
|
|
|
+// tvcell.textview.scrollEnabled=false;
|
|
|
|
|
+
|
|
|
|
|
+ CGPoint current_offset=self.editorTable.contentOffset;
|
|
|
|
|
+
|
|
|
|
|
+ NSLog(@"OFFSET %f",current_offset.y);
|
|
|
|
|
+ CGPoint moveto= CGPointMake(self.editingcell.frame.origin.x,current_offset.y+cover);
|
|
|
|
|
+ [self.editorTable setContentOffset:moveto];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ ;
|
|
|
|
|
+
|
|
|
|
|
+// self.editorTable cell
|
|
|
|
|
+// self.editorTable scrollto
|
|
|
|
|
+// self.editorTable scrollToNearestSelectedRowAtScrollPosition:(UITableViewScrollPosition) animated:<#(BOOL)#>
|
|
|
|
|
+
|
|
|
|
|
+// CGPoint current_offset=self.editorTable.contentOffset;
|
|
|
|
|
+//
|
|
|
|
|
+// NSLog(@"OFFSET %f",current_offset.y);
|
|
|
|
|
+// CGPoint moveto= CGPointMake(self.editingcell.frame.origin.x,current_offset.y+cover);
|
|
|
|
|
+ // [self.editorTable setContentOffset:self.editingcell.frame.origin];
|
|
|
|
|
+// [self.editorTable scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionNone animated:NO];
|
|
|
|
|
+
|
|
|
|
|
+//
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// ===============================================
|
|
// ===============================================
|
|
@@ -6472,127 +6599,187 @@
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//static float table_origin_h = 0;
|
|
|
|
|
-
|
|
|
|
|
-- (void)keyboardWillShow:(NSNotification *)notification {
|
|
|
|
|
- DebugLog(@"keyboardWillShow");
|
|
|
|
|
-//
|
|
|
|
|
-// if(self.keyboard_show)
|
|
|
|
|
-// return;
|
|
|
|
|
-//
|
|
|
|
|
-// self.keyboard_show=true;
|
|
|
|
|
-// /*
|
|
|
|
|
-// Reduce the size of the text view so that it's not obscured by the keyboard.
|
|
|
|
|
-// Animate the resize so that it's in sync with the appearance of the keyboard.
|
|
|
|
|
-// */
|
|
|
|
|
-//
|
|
|
|
|
-// NSDictionary *userInfo = [notification userInfo];
|
|
|
|
|
-//
|
|
|
|
|
-// // Get the origin of the keyboard when it's displayed.
|
|
|
|
|
-// NSValue* aValue = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
|
|
|
|
|
-//
|
|
|
|
|
-// // Get the top of the keyboard as the y coordinate of its origin in self's view's coordinate system. The bottom of the text view's frame should align with the top of the keyboard's final position.
|
|
|
|
|
-// // CGRect keyboardRect = [aValue CGRectValue];
|
|
|
|
|
-// CGSize keyboardSize = [aValue CGRectValue].size;
|
|
|
|
|
-// DebugLog(@"keyboard height:%f",keyboardSize.height);
|
|
|
|
|
-// // Get the duration of the animation.
|
|
|
|
|
-// NSValue *animationDurationValue = [userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey];
|
|
|
|
|
-// NSTimeInterval animationDuration;
|
|
|
|
|
-// [animationDurationValue getValue:&animationDuration];
|
|
|
|
|
-//
|
|
|
|
|
-//
|
|
|
|
|
-// // if(self.keyboard_h==0)
|
|
|
|
|
-// // {
|
|
|
|
|
-// self.keyboard_h =keyboardSize.height;
|
|
|
|
|
-// CGRect cellrect_screen = [RAUtils relativeFrameForScreenWithView:self.editingcell];
|
|
|
|
|
-// CGRect rect_screen = [ UIScreen mainScreen ].bounds;
|
|
|
|
|
-//
|
|
|
|
|
-// // int vpos =self.view.frame.origin.y+self.view.frame.size.height;
|
|
|
|
|
-// // int loginpos = self.editingcell.frame.origin.y+self.editingcell.frame.size.height;
|
|
|
|
|
-// //
|
|
|
|
|
-// int cellpos = cellrect_screen.origin.y+cellrect_screen.size.height;
|
|
|
|
|
-// // screen.size.height-keyboardSize.height-(cellpos_screen.origin.x+cellpos_screen.size.height);
|
|
|
|
|
-// self.ioffset = cellpos-(rect_screen.size.height-keyboardSize.height);//rect_screen.size.height-keyboardSize.height-(rect_screen.origin.y+rect_screen.size.height);//keyboardSize.height -(self.view.frame.size.height-loginpos);
|
|
|
|
|
-// if(self.ioffset>0)
|
|
|
|
|
|
|
+- (void)keyboardDidChangeFrame:(NSNotification *)notification {
|
|
|
|
|
+ NSLog(@"keyboardDidChangeFrame");
|
|
|
|
|
+// NSString *cellclass;
|
|
|
|
|
+// const char *class_name_ch = object_getClassName([self.editingcell class]);
|
|
|
|
|
+// cellclass = [NSString stringWithUTF8String:class_name_ch];
|
|
|
|
|
+//
|
|
|
|
|
+// CommonEditorCellTextView * tvcell=nil;
|
|
|
|
|
+// if([cellclass isEqualToString:@"CommonEditorCellTextView"])
|
|
|
// {
|
|
// {
|
|
|
-// // self.resize = true;
|
|
|
|
|
-//
|
|
|
|
|
-//
|
|
|
|
|
-// CGPoint contentOffsetPoint = self.editorTable.contentOffset;
|
|
|
|
|
-//
|
|
|
|
|
//
|
|
//
|
|
|
-// contentOffsetPoint.y+=self.ioffset;
|
|
|
|
|
|
|
+// tvcell=(CommonEditorCellTextView*)self.editingcell;
|
|
|
|
|
+// tvcell.textview.scrollEnabled=true;
|
|
|
//
|
|
//
|
|
|
-// self.editorTable.contentOffset=contentOffsetPoint;
|
|
|
|
|
//
|
|
//
|
|
|
-//
|
|
|
|
|
-// // NSTimeInterval animationDuration = 0.30f;
|
|
|
|
|
-// // CGRect frame = self.view.frame;
|
|
|
|
|
-// // frame.origin.y -=self.ioffset;//view的Y轴上移
|
|
|
|
|
-// // frame.size.height +=self.ioffset; //View的高度增加
|
|
|
|
|
-// // self.view.frame = frame;
|
|
|
|
|
-// // [UIView beginAnimations:@"ResizeView" context:nil];
|
|
|
|
|
-// // [UIView setAnimationDuration:animationDuration];
|
|
|
|
|
-// // self.view.frame = frame;
|
|
|
|
|
-// // [UIView commitAnimations];//设置调整界面的动画效果
|
|
|
|
|
// }
|
|
// }
|
|
|
-//
|
|
|
|
|
-// table_origin_h = self.editorTable.frame.size.height;
|
|
|
|
|
-// self.editorTable.frame = CGRectMake(0, 0, self.editorTable.frame.size.width, self.editorTable.frame.size.height-self.keyboard_h);
|
|
|
|
|
-//
|
|
|
|
|
-// // CGSize tablecontent =self.editorTable.contentSize;
|
|
|
|
|
-// // tablecontent.height=tablecontent.height+self.keyboard_h;
|
|
|
|
|
-// // self.editorTable.contentSize=tablecontent;
|
|
|
|
|
-// // }
|
|
|
|
|
-// // Animate the resize of the text view's frame in sync with the keyboard's appearance.
|
|
|
|
|
-// // [self moveInputBarWithKeyboardHeight:keyboardRect.size.height withDuration:animationDuration];
|
|
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // 使用tableContainer计算frame 保证屏幕旋转后table height正确
|
|
|
|
|
+ // CGRect table_origin_screen_frame = [self.tableContainer convertRect:self.tableContainer.bounds toView:self.view.window];
|
|
|
|
|
+
|
|
|
|
|
+ CGRect screen_rect = [RAUtils relativeFrameForScreenWithView:self.editorTable];
|
|
|
|
|
+ //
|
|
|
|
|
+ // // NSTimeInterval duration = [[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue];
|
|
|
|
|
+ // // duration *= 0.0;
|
|
|
|
|
+ CGRect end = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
|
|
|
|
|
+// CGRect begin = [[[notification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue];
|
|
|
|
|
+ float kbheight = end.size.height;
|
|
|
|
|
+ CGFloat keyboard_top = end.origin.y;
|
|
|
|
|
+ NSLog(@"keyboard rect: %@",NSStringFromCGRect(end));
|
|
|
|
|
+
|
|
|
|
|
+ NSLog(@"view rect: %@",NSStringFromCGRect(self.view.frame));
|
|
|
|
|
+ NSLog(@"view screen rect: %@",NSStringFromCGRect(screen_rect));
|
|
|
|
|
+
|
|
|
|
|
+ // self.view.frame = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height);
|
|
|
|
|
+
|
|
|
|
|
+ float dark = screen_rect.origin.y+screen_rect.size.height-keyboard_top;
|
|
|
|
|
+
|
|
|
|
|
+ if(dark>0)
|
|
|
|
|
+ {
|
|
|
|
|
+// self.editorTable.scrollEnabled = true;
|
|
|
|
|
+// self.editorTable.contentSize = CGSizeMake(self.editorTable.frame.size.width, self.editorTable.frame.size.height+dark);
|
|
|
|
|
+
|
|
|
|
|
+ self.editorTable.contentSize=CGSizeMake(self.editorTable.contentSize.width, self.editorTable.contentSize.height+kbheight);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+// self.editorTable.scrollEnabled = false;
|
|
|
|
|
+// self.editorTable.contentSize = self.editorTable.frame.size;
|
|
|
|
|
+ self.editorTable.contentSize=CGSizeMake(self.editorTable.contentSize.width, self.editorTable.contentSize.height-kbheight);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
-- (void)keyboardWillHide:(NSNotification *)notification {
|
|
|
|
|
- DebugLog(@"keyboardWillHide");
|
|
|
|
|
-
|
|
|
|
|
-// self.keyboard_show=false;
|
|
|
|
|
-// NSDictionary* userInfo = [notification userInfo];
|
|
|
|
|
-//
|
|
|
|
|
-// /*
|
|
|
|
|
-// Restore the size of the text view (fill self's view).
|
|
|
|
|
-// Animate the resize so that it's in sync with the disappearance of the keyboard.
|
|
|
|
|
-// */
|
|
|
|
|
-// NSValue *animationDurationValue = [userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey];
|
|
|
|
|
-// NSTimeInterval animationDuration;
|
|
|
|
|
-// [animationDurationValue getValue:&animationDuration];
|
|
|
|
|
-// CGSize tablecontent =self.editorTable.contentSize;
|
|
|
|
|
-// tablecontent.height=tablecontent.height-self.keyboard_h;
|
|
|
|
|
-// // self.editorTable.contentSize=tablecontent;
|
|
|
|
|
-//
|
|
|
|
|
-// self.editorTable.frame = CGRectMake(0, 0, self.editorTable.frame.size.width, table_origin_h);
|
|
|
|
|
-//
|
|
|
|
|
-// self.keyboard_h= 0;
|
|
|
|
|
-// DebugLog(@"before refresh %@",NSStringFromCGSize(self.editorTable.contentSize));
|
|
|
|
|
-//
|
|
|
|
|
-//
|
|
|
|
|
-// // if(self.resize)
|
|
|
|
|
-// // {
|
|
|
|
|
-// // NSTimeInterval animationDuration = 0.30f;
|
|
|
|
|
-// // CGRect frame = self.view.frame;
|
|
|
|
|
-// // // if(prewTag == textField.tag) //当结束编辑的View的TAG是上次的就移动
|
|
|
|
|
-// // // { //还原界面
|
|
|
|
|
-// // // moveY = prewMoveY;
|
|
|
|
|
-// // frame.origin.y +=self.ioffset;
|
|
|
|
|
-// // frame.size. height -=self.ioffset;
|
|
|
|
|
-// // self.view.frame = frame;
|
|
|
|
|
-// // // }
|
|
|
|
|
-// // //self.view移回原位置
|
|
|
|
|
-// // [UIView beginAnimations:@"ResizeView" context:nil];
|
|
|
|
|
-// // [UIView setAnimationDuration:animationDuration];
|
|
|
|
|
-// // self.view.frame = frame;
|
|
|
|
|
-// // [UIView commitAnimations];
|
|
|
|
|
-// // //[textField resignFirstResponder];
|
|
|
|
|
-// // self.ioffset=0;
|
|
|
|
|
-// // }
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+//static float table_origin_h = 0;
|
|
|
//
|
|
//
|
|
|
|
|
+//- (void)keyboardWillShow:(NSNotification *)notification {
|
|
|
|
|
+// DebugLog(@"keyboardWillShow");
|
|
|
|
|
+////
|
|
|
|
|
+//// if(self.keyboard_show)
|
|
|
|
|
+//// return;
|
|
|
|
|
+////
|
|
|
|
|
+//// self.keyboard_show=true;
|
|
|
|
|
+//// /*
|
|
|
|
|
+//// Reduce the size of the text view so that it's not obscured by the keyboard.
|
|
|
|
|
+//// Animate the resize so that it's in sync with the appearance of the keyboard.
|
|
|
|
|
+//// */
|
|
|
|
|
+////
|
|
|
|
|
+//// NSDictionary *userInfo = [notification userInfo];
|
|
|
|
|
+////
|
|
|
|
|
+//// // Get the origin of the keyboard when it's displayed.
|
|
|
|
|
+//// NSValue* aValue = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
|
|
|
|
|
+////
|
|
|
|
|
+//// // Get the top of the keyboard as the y coordinate of its origin in self's view's coordinate system. The bottom of the text view's frame should align with the top of the keyboard's final position.
|
|
|
|
|
+//// // CGRect keyboardRect = [aValue CGRectValue];
|
|
|
|
|
+//// CGSize keyboardSize = [aValue CGRectValue].size;
|
|
|
|
|
+//// DebugLog(@"keyboard height:%f",keyboardSize.height);
|
|
|
|
|
+//// // Get the duration of the animation.
|
|
|
|
|
+//// NSValue *animationDurationValue = [userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey];
|
|
|
|
|
+//// NSTimeInterval animationDuration;
|
|
|
|
|
+//// [animationDurationValue getValue:&animationDuration];
|
|
|
|
|
+////
|
|
|
|
|
+////
|
|
|
|
|
+//// // if(self.keyboard_h==0)
|
|
|
|
|
+//// // {
|
|
|
|
|
+//// self.keyboard_h =keyboardSize.height;
|
|
|
|
|
+//// CGRect cellrect_screen = [RAUtils relativeFrameForScreenWithView:self.editingcell];
|
|
|
|
|
+//// CGRect rect_screen = [ UIScreen mainScreen ].bounds;
|
|
|
|
|
+////
|
|
|
|
|
+//// // int vpos =self.view.frame.origin.y+self.view.frame.size.height;
|
|
|
|
|
+//// // int loginpos = self.editingcell.frame.origin.y+self.editingcell.frame.size.height;
|
|
|
|
|
+//// //
|
|
|
|
|
+//// int cellpos = cellrect_screen.origin.y+cellrect_screen.size.height;
|
|
|
|
|
+//// // screen.size.height-keyboardSize.height-(cellpos_screen.origin.x+cellpos_screen.size.height);
|
|
|
|
|
+//// self.ioffset = cellpos-(rect_screen.size.height-keyboardSize.height);//rect_screen.size.height-keyboardSize.height-(rect_screen.origin.y+rect_screen.size.height);//keyboardSize.height -(self.view.frame.size.height-loginpos);
|
|
|
|
|
+//// if(self.ioffset>0)
|
|
|
|
|
+//// {
|
|
|
|
|
+//// // self.resize = true;
|
|
|
|
|
+////
|
|
|
|
|
+////
|
|
|
|
|
+//// CGPoint contentOffsetPoint = self.editorTable.contentOffset;
|
|
|
|
|
+////
|
|
|
|
|
+////
|
|
|
|
|
+//// contentOffsetPoint.y+=self.ioffset;
|
|
|
|
|
+////
|
|
|
|
|
+//// self.editorTable.contentOffset=contentOffsetPoint;
|
|
|
|
|
+////
|
|
|
|
|
+////
|
|
|
|
|
+//// // NSTimeInterval animationDuration = 0.30f;
|
|
|
|
|
+//// // CGRect frame = self.view.frame;
|
|
|
|
|
+//// // frame.origin.y -=self.ioffset;//view的Y轴上移
|
|
|
|
|
+//// // frame.size.height +=self.ioffset; //View的高度增加
|
|
|
|
|
+//// // self.view.frame = frame;
|
|
|
|
|
+//// // [UIView beginAnimations:@"ResizeView" context:nil];
|
|
|
|
|
+//// // [UIView setAnimationDuration:animationDuration];
|
|
|
|
|
+//// // self.view.frame = frame;
|
|
|
|
|
+//// // [UIView commitAnimations];//设置调整界面的动画效果
|
|
|
|
|
+//// }
|
|
|
|
|
+////
|
|
|
|
|
+//// table_origin_h = self.editorTable.frame.size.height;
|
|
|
|
|
+//// self.editorTable.frame = CGRectMake(0, 0, self.editorTable.frame.size.width, self.editorTable.frame.size.height-self.keyboard_h);
|
|
|
|
|
+////
|
|
|
|
|
+//// // CGSize tablecontent =self.editorTable.contentSize;
|
|
|
|
|
+//// // tablecontent.height=tablecontent.height+self.keyboard_h;
|
|
|
|
|
+//// // self.editorTable.contentSize=tablecontent;
|
|
|
|
|
+//// // }
|
|
|
|
|
+//// // Animate the resize of the text view's frame in sync with the keyboard's appearance.
|
|
|
|
|
+//// // [self moveInputBarWithKeyboardHeight:keyboardRect.size.height withDuration:animationDuration];
|
|
|
|
|
+//}
|
|
|
|
|
+//- (void)keyboardWillHide:(NSNotification *)notification {
|
|
|
|
|
+// DebugLog(@"keyboardWillHide");
|
|
|
//
|
|
//
|
|
|
-// // [self moveInputBarWithKeyboardHeight:0.0 withDuration:animationDuration];
|
|
|
|
|
-}
|
|
|
|
|
|
|
+//// self.keyboard_show=false;
|
|
|
|
|
+//// NSDictionary* userInfo = [notification userInfo];
|
|
|
|
|
+////
|
|
|
|
|
+//// /*
|
|
|
|
|
+//// Restore the size of the text view (fill self's view).
|
|
|
|
|
+//// Animate the resize so that it's in sync with the disappearance of the keyboard.
|
|
|
|
|
+//// */
|
|
|
|
|
+//// NSValue *animationDurationValue = [userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey];
|
|
|
|
|
+//// NSTimeInterval animationDuration;
|
|
|
|
|
+//// [animationDurationValue getValue:&animationDuration];
|
|
|
|
|
+//// CGSize tablecontent =self.editorTable.contentSize;
|
|
|
|
|
+//// tablecontent.height=tablecontent.height-self.keyboard_h;
|
|
|
|
|
+//// // self.editorTable.contentSize=tablecontent;
|
|
|
|
|
+////
|
|
|
|
|
+//// self.editorTable.frame = CGRectMake(0, 0, self.editorTable.frame.size.width, table_origin_h);
|
|
|
|
|
+////
|
|
|
|
|
+//// self.keyboard_h= 0;
|
|
|
|
|
+//// DebugLog(@"before refresh %@",NSStringFromCGSize(self.editorTable.contentSize));
|
|
|
|
|
+////
|
|
|
|
|
+////
|
|
|
|
|
+//// // if(self.resize)
|
|
|
|
|
+//// // {
|
|
|
|
|
+//// // NSTimeInterval animationDuration = 0.30f;
|
|
|
|
|
+//// // CGRect frame = self.view.frame;
|
|
|
|
|
+//// // // if(prewTag == textField.tag) //当结束编辑的View的TAG是上次的就移动
|
|
|
|
|
+//// // // { //还原界面
|
|
|
|
|
+//// // // moveY = prewMoveY;
|
|
|
|
|
+//// // frame.origin.y +=self.ioffset;
|
|
|
|
|
+//// // frame.size. height -=self.ioffset;
|
|
|
|
|
+//// // self.view.frame = frame;
|
|
|
|
|
+//// // // }
|
|
|
|
|
+//// // //self.view移回原位置
|
|
|
|
|
+//// // [UIView beginAnimations:@"ResizeView" context:nil];
|
|
|
|
|
+//// // [UIView setAnimationDuration:animationDuration];
|
|
|
|
|
+//// // self.view.frame = frame;
|
|
|
|
|
+//// // [UIView commitAnimations];
|
|
|
|
|
+//// // //[textField resignFirstResponder];
|
|
|
|
|
+//// // self.ioffset=0;
|
|
|
|
|
+//// // }
|
|
|
|
|
+////
|
|
|
|
|
+////
|
|
|
|
|
+//// // [self moveInputBarWithKeyboardHeight:0.0 withDuration:animationDuration];
|
|
|
|
|
+//}
|
|
|
|
|
|
|
|
#pragma mark - RageCell Delegate
|
|
#pragma mark - RageCell Delegate
|
|
|
|
|
|