码迷,mamicode.com
首页 > 其他好文 > 详细

UIPopoverPresentationController的使用

时间:2014-10-16 18:45:32      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:ios

UIPopoverPresentationController的使用

by 伍雪颖

let detailsButton: UIBarButtonItem = UIBarButtonItem(title: "PopView", style: UIBarButtonItemStyle.Plain, target: self, action: "displayPopView:")
navigationItem.rightBarButtonItem = detailsButton
   
func displayPopView(sender: UIBarButtonItem) {
    let storyboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
    var contentViewController : CountryPopoverViewController = storyboard.instantiateViewControllerWithIdentifier(
        "PopoverViewController")
        as CountryPopoverViewController; contentViewController.country = country
    contentViewController.modalPresentationStyle = UIModalPresentationStyle.Popover
    var detailPopover: UIPopoverPresentationController = contentViewController.popoverPresentationController!
    detailPopover.barButtonItem = sender
    UIPopoverArrowDirection.Any; presentViewController(contentViewController,
        animated: true, completion:nil)
}


UIPopoverPresentationController的使用

标签:ios

原文地址:http://blog.csdn.net/rainlesvio/article/details/40151509

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!