美文网首页
推出半透明的ViewController

推出半透明的ViewController

作者: 纯阳子_ | 来源:发表于2016-09-05 21:28 被阅读11次

    //初始化

    GoodsAttrViewController  *goodsAttr = (GoodsAttrViewController*)[mainStoryboard instantiateViewControllerWithIdentifier:@"goodsAttr"];

    //设置背景色(alpha:0.5)

    goodsAttr.view.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];

    if ([[[UIDevice currentDevice]systemVersion]floatValue]>= 8.0) {

    goodsAttr.modalPresentationStyle = UIModalPresentationOverFullScreen;

    } else {

    self.modalPresentationStyle = UIModalPresentationFullScreen;

    }

    //模态出

    [self.navigationController showDetailViewController:goodsAttr sender:nil];

    相关文章

      网友评论

          本文标题:推出半透明的ViewController

          本文链接:https://www.haomeiwen.com/subject/viowhttx.html