|
|
@@ -4850,7 +4850,16 @@ if(!self.alert.isBeingDismissed)
|
|
|
return myView;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView
|
|
|
+{
|
|
|
+ NSLog(@"Did Scroll %f",scrollView.contentOffset.y);
|
|
|
+// CGPoint contentOffsetPoint = scrollView.contentOffset;
|
|
|
+ CGRect f = self.autocompleteView.frame;
|
|
|
+ CGRect rframe=[RAUtils relativeFrameForScreenWithView:self.lastedit];
|
|
|
+ NSLog(@"edit y %f",rframe.origin.y);
|
|
|
+ self.autocompleteView.frame = CGRectMake(f.origin.x, rframe.origin.y+rframe.size.height, f.size.width, f.size.height);
|
|
|
+
|
|
|
+}
|
|
|
//
|
|
|
-(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
|
|
{
|
|
|
@@ -6034,10 +6043,35 @@ if(!self.alert.isBeingDismissed)
|
|
|
|
|
|
NSString* keyboard = [item_json valueForKey:@"keyboard"];
|
|
|
if(![keyboard isEqualToString:@"number"] && ![keyboard isEqualToString:@"int"])
|
|
|
- { if(lenth==0)
|
|
|
+ {
|
|
|
+ if(lenth==0)
|
|
|
+ {
|
|
|
+ if([item_json[@"autocomplete"] boolValue])
|
|
|
+ {
|
|
|
+ self.autocompleteView.hidden = false;
|
|
|
+
|
|
|
+ CGRect f = self.autocompleteView.frame;
|
|
|
+ CGRect rframe=[RAUtils relativeFrameForScreenWithView:textField];
|
|
|
+ NSLog(@"edit y %f",rframe.origin.y);
|
|
|
+ self.autocompleteView.frame = CGRectMake(f.origin.x, rframe.origin.y+rframe.size.height, f.size.width, f.size.height);
|
|
|
+
|
|
|
+ [self.autocompleteView performSearch:textField.text];
|
|
|
+ }
|
|
|
return TRUE;
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
+ if([item_json[@"autocomplete"] boolValue])
|
|
|
+ {
|
|
|
+ self.autocompleteView.hidden = false;
|
|
|
+
|
|
|
+ CGRect f = self.autocompleteView.frame;
|
|
|
+ CGRect rframe=[RAUtils relativeFrameForScreenWithView:textField];
|
|
|
+ NSLog(@"edit y %f",rframe.origin.y);
|
|
|
+ self.autocompleteView.frame = CGRectMake(f.origin.x, rframe.origin.y+rframe.size.height, f.size.width, f.size.height);
|
|
|
+
|
|
|
+ [self.autocompleteView performSearch:textField.text];
|
|
|
+ }
|
|
|
return (lenth>textField.text.length ||[string isEqualToString:@""]);
|
|
|
}
|
|
|
}
|
|
|
@@ -6052,13 +6086,48 @@ if(!self.alert.isBeingDismissed)
|
|
|
BOOL canChange = [string isEqualToString:filtered];
|
|
|
|
|
|
|
|
|
+// if([item_json[@"autocomplete"] boolValue]==true&&canChange)
|
|
|
+// {
|
|
|
+//
|
|
|
+// }
|
|
|
+
|
|
|
if(lenth==0)
|
|
|
+ {
|
|
|
+ if([item_json[@"autocomplete"] boolValue])
|
|
|
+ {
|
|
|
+ self.autocompleteView.hidden = false;
|
|
|
+
|
|
|
+ CGRect f = self.autocompleteView.frame;
|
|
|
+ CGRect rframe=[RAUtils relativeFrameForScreenWithView:textField];
|
|
|
+ NSLog(@"edit y %f",rframe.origin.y);
|
|
|
+ self.autocompleteView.frame = CGRectMake(f.origin.x, rframe.origin.y+rframe.size.height, f.size.width, f.size.height);
|
|
|
+
|
|
|
+ [self.autocompleteView performSearch:textField.text];
|
|
|
+
|
|
|
+ }
|
|
|
return canChange;
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
+ if([item_json[@"autocomplete"] boolValue])
|
|
|
+ {
|
|
|
+ self.autocompleteView.hidden = false;
|
|
|
+
|
|
|
+ CGRect f = self.autocompleteView.frame;
|
|
|
+ CGRect rframe=[RAUtils relativeFrameForScreenWithView:textField];
|
|
|
+ NSLog(@"edit y %f",rframe.origin.y);
|
|
|
+ self.autocompleteView.frame = CGRectMake(f.origin.x, rframe.origin.y+rframe.size.height, f.size.width, f.size.height);
|
|
|
+
|
|
|
+ [self.autocompleteView performSearch:textField.text];
|
|
|
+ }
|
|
|
return canChange&& (lenth>textField.text.length ||[string isEqualToString:@""]);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+//- (void)textFieldDidChangeSelection:(UITextField *)textField
|
|
|
+//{
|
|
|
+//
|
|
|
+//}
|
|
|
- (void)textFieldDidEndEditing:(UITextField *)textField
|
|
|
{
|
|
|
|
|
|
@@ -6074,7 +6143,10 @@ if(!self.alert.isBeingDismissed)
|
|
|
textField.text = fillText;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if([item_json[@"autocomplete"] boolValue])
|
|
|
+ {
|
|
|
+ self.autocompleteView.hidden = true;
|
|
|
+ }
|
|
|
[self textfieldSetValue:indexPath value:textField.text];
|
|
|
// NSMutableDictionary* section_json=nil;
|
|
|
//
|
|
|
@@ -6356,7 +6428,12 @@ if(!self.alert.isBeingDismissed)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+- (BOOL)textFieldShouldReturn:(UITextField *)textField
|
|
|
+{
|
|
|
+// [self searchAction];
|
|
|
+ [textField resignFirstResponder];
|
|
|
+ return YES;
|
|
|
+}
|
|
|
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
|
|
|
|
|
|
self.editingcell = (UITableViewCell*)textField.superview.superview;
|
|
|
@@ -6367,9 +6444,10 @@ if(!self.alert.isBeingDismissed)
|
|
|
if([item_json[@"autocomplete"] boolValue]==true)
|
|
|
{
|
|
|
// [textField endEditing:true];
|
|
|
+
|
|
|
self.lastedit_from = [self.editorTable indexPathForCell:(UITableViewCell*) textField.superview.superview];
|
|
|
self.autocompleteView.active_field = textField;
|
|
|
- self.autocompleteView.hidden = false;
|
|
|
+// self.autocompleteView.hidden = false;
|
|
|
self.autocompleteView.searchInput.keyboardType=textField.keyboardType;
|
|
|
self.autocompleteView.searchInput.text= textField.text;
|
|
|
[self.autocompleteView.searchInput becomeFirstResponder];
|
|
|
@@ -6382,7 +6460,12 @@ if(!self.alert.isBeingDismissed)
|
|
|
|
|
|
[weakself textFieldDidEndEditing:textField];
|
|
|
};
|
|
|
- return false;
|
|
|
+
|
|
|
+ CGRect rframe=[RAUtils relativeFrameForScreenWithView:textField];
|
|
|
+
|
|
|
+ self.autocompleteView.frame= CGRectMake(rframe.origin.x,rframe.origin.y+rframe.size.height,rframe.size.width,400);//CGRectMake(screenframe.origin.x, screenframe.origin.y, screenframe.size.width, end_y);
|
|
|
+
|
|
|
+// return false;
|
|
|
}
|
|
|
|
|
|
return YES;
|
|
|
@@ -6806,7 +6889,8 @@ if(!self.alert.isBeingDismissed)
|
|
|
CGFloat end_y = end.origin.y;
|
|
|
|
|
|
CGRect screenframe=[[UIScreen mainScreen] bounds];
|
|
|
- self.autocompleteView.frame= CGRectMake(screenframe.origin.x, screenframe.origin.y, screenframe.size.width, end_y);
|
|
|
+// CGRect controlframe= self.lastedit.frame;
|
|
|
+// self.autocompleteView.frame= CGRectMake(200,200,200,200);//CGRectMake(screenframe.origin.x, screenframe.origin.y, screenframe.size.width, end_y);
|
|
|
|
|
|
NSIndexPath *indexPath = [self.editorTable indexPathForCell:self.editingcell];
|
|
|
|
|
|
@@ -6854,6 +6938,7 @@ if(!self.alert.isBeingDismissed)
|
|
|
|
|
|
|
|
|
}
|
|
|
+
|
|
|
} else {
|
|
|
// contentInset = (top = 64, left = 0, bottom = 0, right = 0),topAvailableHeight = -64
|
|
|
table_frame.size.height = table_origin_screen_frame.size.height - offset;
|
|
|
@@ -6883,6 +6968,7 @@ if(!self.alert.isBeingDismissed)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
self.editorTable.frame = table_frame;
|
|
|
|
|
|
CGRect cell_screen_frame = [self.editingcell convertRect:self.editingcell.bounds toView:self.view.window];
|