Search code examples
iosipaduipopovercontrolleruiactionsheet

How to show buttons horizontally in uipopoverviewcontroller


I want to create a popoverviewcontroller with 3 buttons only(Add, Delete, Edit). It should show horizantally. I used Action sheet but its showing vertically. How to achieve this?

Thanks

--J


Solution

    • Create a Viewcontroller with 3 buttons horizontally and there action
    • set the contentsizeInPopover in the viewDidLoad method
    • Set the Xib to freeform and make the desired size with buttons

    show popover

    [popover presentPopoverFromRect:senderButton.bounds inView:senderButton permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];