alvises / FPPopover

FPPopover provides an alternative to the native iOS UIPopoverController, adding support for iPhone and additional opportunities to customize the look and feel of the popovers.
http://www.poeticoding.com/fppopover-a-customizable-uipopovercontroller-for-iphone-and-ipad/
Other
901 stars 250 forks source link

Why does not display when clicking on? #126

Open yuzhongxingke opened 8 years ago

yuzhongxingke commented 8 years ago

-(IBAction)popover:(id)sender { //NSLog(@"popover retain count: %d",[popover retainCount]);

// SAFE_ARC_RELEASE(popover); popover=nil;

//the controller we want to present as a popover
DemoTableController *controller = [[DemoTableController alloc] initWithStyle:UITableViewStylePlain];
controller.delegate = self;
popover = [[FPPopoverKeyboardResponsiveController alloc] initWithViewController:controller];
popover.tint = FPPopoverDefaultTint;

// popover.keyboardHeight = _keyboardHeight;

if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
    popover.contentSize = CGSizeMake(300, 500);
}
else {
    popover.contentSize = CGSizeMake(200, 300);
}
if(sender == transparentPopover)
{
    popover.alpha = 0.5;
}

if(sender == _noArrow) {
    //no arrow
    popover.arrowDirection = FPPopoverNoArrow;
    [popover presentPopoverFromPoint: CGPointMake(self.view.center.x, self.view.center.y - popover.contentSize.height/2)];
}
else {
    //sender is the UIButton view
    popover.arrowDirection = FPPopoverArrowDirectionAny;
    [popover presentPopoverFromView:sender];
}

}