In my JSP page we total some links:Organization DataBusiness
UnitsApplicationsData EntityIt has a jQuery duty purebred for a click
event:$("a.applicationdata").click(function() { var appid =
$(this).attr("id"); $('#gentab a').addClass("tabclick"); $('#gentab
a').attr('href', '#datacollector');});It will supplement a class, tabclick
to that is inside
Thursday, 3 April 2014
Tuesday, 1 April 2014
How do we confine a UIScrollView when a keyboard appears?
I'm carrying problem with my code. I'm perplexing to pierce a UIscrollview
when I'm modifying an UItextfield that should be dark by a keyboard
pop.I'm relocating a sure support right now since we don't know how to
'scroll up' in a code.So, we did a small bit of code, it's operative
glorious though when we correct an UItextfield and we switch to another
UItextfield but dire on a 'return' symbol a sure perspective goes
waaayyyyy to distant up.I did an NSLog() with my variables size, widen and
textFieldRect.origin.y as we can see below. When we put twin UITextField
during a same place (y origin) and we do this sole 'switch' (wihtout dire
return) , we get a same numbers, since my formula worked glorious for a
initial UITextField modifying though not for a second editing.Check this
out:- (void)textFieldDidBeginEditing:(UITextField *)textField {{ int
size; CGRect textFieldRect = [self.view.window
convertRect:textField.bounds fromView:textField]; distance =
textFieldRect.origin.y + textFieldRect.size.height; if (change ==
FALSE) { distance = distance - distance; } if (size <
PORTRAIT_KEYBOARD_HEIGHT) { widen = 0; } else if (size >
PORTRAIT_KEYBOARD_HEIGHT) { widen = distance -
PORTRAIT_KEYBOARD_HEIGHT + 5; // +5 px for some-more prominence }
NSLog(@"origin %f", textFieldRect.origin.y); NSLog(@"size %d", size);
NSLog(@"distance %d", distance); CGRect viewFrame = self.view.frame;
viewFrame.origin.y -= distance; [UIView beginAnimations:nil
context:NULL]; [UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDuration:KEYBOARD_ANIMATION_DURATION]; [self.view
setFrame:viewFrame]; [UIView commitAnimations]; change = FALSE;}-
(void)textFieldDidEndEditing:(UITextField *)textField{ change = TRUE;
CGRect viewFrame = self.view.frame; viewFrame.origin.y += distance;
[UIView beginAnimations:nil context:NULL]; [UIView
setAnimationBeginsFromCurrentState:YES]; [UIView
setAnimationDuration:KEYBOARD_ANIMATION_DURATION]; [self.view
setFrame:viewFrame]; [UIView commitAnimations];}Any ideas ?
when I'm modifying an UItextfield that should be dark by a keyboard
pop.I'm relocating a sure support right now since we don't know how to
'scroll up' in a code.So, we did a small bit of code, it's operative
glorious though when we correct an UItextfield and we switch to another
UItextfield but dire on a 'return' symbol a sure perspective goes
waaayyyyy to distant up.I did an NSLog() with my variables size, widen and
textFieldRect.origin.y as we can see below. When we put twin UITextField
during a same place (y origin) and we do this sole 'switch' (wihtout dire
return) , we get a same numbers, since my formula worked glorious for a
initial UITextField modifying though not for a second editing.Check this
out:- (void)textFieldDidBeginEditing:(UITextField *)textField {{ int
size; CGRect textFieldRect = [self.view.window
convertRect:textField.bounds fromView:textField]; distance =
textFieldRect.origin.y + textFieldRect.size.height; if (change ==
FALSE) { distance = distance - distance; } if (size <
PORTRAIT_KEYBOARD_HEIGHT) { widen = 0; } else if (size >
PORTRAIT_KEYBOARD_HEIGHT) { widen = distance -
PORTRAIT_KEYBOARD_HEIGHT + 5; // +5 px for some-more prominence }
NSLog(@"origin %f", textFieldRect.origin.y); NSLog(@"size %d", size);
NSLog(@"distance %d", distance); CGRect viewFrame = self.view.frame;
viewFrame.origin.y -= distance; [UIView beginAnimations:nil
context:NULL]; [UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDuration:KEYBOARD_ANIMATION_DURATION]; [self.view
setFrame:viewFrame]; [UIView commitAnimations]; change = FALSE;}-
(void)textFieldDidEndEditing:(UITextField *)textField{ change = TRUE;
CGRect viewFrame = self.view.frame; viewFrame.origin.y += distance;
[UIView beginAnimations:nil context:NULL]; [UIView
setAnimationBeginsFromCurrentState:YES]; [UIView
setAnimationDuration:KEYBOARD_ANIMATION_DURATION]; [self.view
setFrame:viewFrame]; [UIView commitAnimations];}Any ideas ?
Subscribe to:
Comments (Atom)