objective c - How to show a UIPopoverController in a UITableViewController at a fixed location? -
so i've got uitableviewcontroller , on didselectrowatindexpath: want display uipopovercontroller in fixed spot on screen, situation want arrow pointing right in landscape mode in middle of right portion of screen. what's happening when list longer screen , when i've scrolled down further entries make point it's pointing @ higher , higher off screen. understand why have isn't working - looking solution. code have pasted below if out appreciated!
popcontroller = [[uipopovercontroller alloc] initwithcontentviewcontroller:aplayerdetail]; popcontroller.popovercontentsize = cgsizemake(320, 580); [popcontroller presentpopoverfromrect:cgrectmake(1024, self.view.frame.size.height / 2, 1, 1) inview:self.view permittedarrowdirections:uipopoverarrowdirectionright animated:yes]; [playerdetailviewcontroller setpopover:popcontroller];
use bounds
instead of frame
, offset popover's y
coordinate current bounds.origin.y
changes scroll up/down:
[popcontroller presentpopoverfromrect:cgrectmake(1024, self.view.bounds.origin.y + (self.view.bounds.size.height / 2), 1, 1) inview:self.view permittedarrowdirections:uipopoverarrowdirectionright animated:yes];
Comments
Post a Comment