ios - Have keyboard already presented on view on viewDidAppear? -
i have uipageviewcontroller
initialized 3 controllers. when swipe right, presenting uiview
has uitextview
becomes firstresponder. trying achieve have keyboard appearing when user swipes right, , when swipe away hide keyboard within view. seems keyboard added onto window? facebook seems achieve when posting new post, keyboard seems loaded before view appears?
i able keyboard show without animating keyboard when becomefirstresponder
invoked on uitextview. there seems delay on when keyboard appears.
self.composeview.bodytextview.inputaccessoryview = [uiview new]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(willshowkeyboard:) name:uikeyboardwillshownotification object:nil]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(didshowkeyboard:) name:uikeyboarddidshownotification object:nil];
it seem show view controller , pop keyboard @ same time cause delay.
suggestion let keyboard show little later. can either put [textview becomefirstresponder]
in viewdidappear:
or subclassing uitextfield override didmovetosuperview
(put [self becomefirstresponder]
on it).
Comments
Post a Comment