ios - inputAcessoryView being displayed with UIAlertController -
i have overridden -inputaccessoryview: method in uiviewcontroller returns view displayed on top of keyboard shown while editing uitextfield on viewcontroller's view.
-(uiview *)inputaccessoryview; i presenting uialertcontroller viewcontroller.
uialertcontroller *alert = [uialertcontroller alertcontrollerwithtitle:@"save profile" message:@"you have made changes profile. want save them?" preferredstyle:uialertcontrollerstylealert]; [alert addaction:[uialertaction actionwithtitle:@"cancel" style:uialertactionstylecancel handler:nil]]; [alert addaction:[uialertaction actionwithtitle:@"save" style:uialertactionstyledefault handler:^(uialertaction *action) { //code save profile. }]]; [self presentviewcontroller:alert animated:yes completion:nil]; as can see have not added textfield uialertcontroller.
weirdly, inputacessoryview turns @ bottom of screen when uialertcontroller presented.
is bug, or have overlooked something?
rename input accessory view other inputaccessoryview. e.g. keyboardaccessoryview.
then add following line
self.m_textfieldname.inputaccessoryview = [self keyboardinputaccessoryview]; this solved problem me.
Comments
Post a Comment