ios - Popover controller not dismiss when click on other bar button but dismiss when click other button(or outside popover) -


i show popover using - "presentpopoverfrombarbuttonitem" - after popover not dismiss when click on other bar button item in right navigation bar buttons.

but dismiss popover when click elsewhere. issue not there when show popover using - " presentpopoverfromrect: inview: " - strange?.

since don't frame uibarbuttonitem how can show popover correctly barbutton.

thanks,

answering own question one,

// presenting barbutton not dismiss popover when click on other bar button. // [self.popovercontroller presentpopoverfrombarbuttonitem:self.barbutton permittedarrowdirections:uipopoverarrowdirectionany animated:yes];  nsmutablearray* buttons = [[nsmutablearray alloc] init]; (uiview *subview in self.navigationcontroller.navigationbar.subviews) {     if ([subview iskindofclass:[uicontrol class]])   {         [buttons addobject:subview];     } }  uiview *view = [buttons objectatindex:1]; // '1' index bar item in array of .items  cgrect barbuttonframe = [self.navigationcontroller.navigationbar convertrect:view.frame toview:self.navigationcontroller.view]; [self.popovercontroller presentpopoverfromrect:barbuttonframe inview:self.navigationcontroller.view permittedarrowdirections:uipopoverarrowdirectionup animated:yes]; 

what did above find frame of bar button , show popover "presentpopoverfromrect".


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -