PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > 开发编程 > iOS开发教程 > 正文

    弹出菜单调用,view覆盖全屏封装方法

    作者:张志勇来源:原创浏览:时间:2020-09-30 00:07:50我要评论
    导读:#pragma mark --- 封装调用creat&cancel弹出窗口//周期性-(void)createViewCyclicityFirstResponder{ // 为页面视图添加手势,当点...
    #pragma mark --- 封装调用creat&cancel弹出窗口

    //周期性

    -(void)createViewCyclicityFirstResponder

    {

        // 为页面视图添加手势,当点击页面任何一处时收回键盘

        [self removeKeyboardAndAlertView];

        addEventTapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(cancelViewCyclicityFirstResponder)];

        addEventTapGesture.delegate = self;

        addEventTapGesture.cancelsTouchesInView = YES;

        

        viewBackAddEvent=[[UIView alloc]initWith :CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];

        [viewBackAddEvent setBackgroundColor:[UIColor colorWithRed:35/255.0 green:35/255.0 blue:35/255.0 alpha:0.6]];

        

        [viewBackAddEvent addGestureRecognizer:addEventTapGesture];

        [[[UIApplication sharedApplication].windows first ] addSubview:viewBackAddEvent];

    //这句话是view覆盖全屏

        

        //下拉菜单

        self.cyclicityView = [[UIView alloc] initWith :CGRectMake(30, (viewBackAddEvent. .size.height)/2-64, self.view. .size.width-60, 200)];

        self.cyclicityView.backgroundColor = [UIColor whiteColor];

        [viewBackAddEvent addSubview:self.cyclicityView];

        

        

    }

     

    -(void)cancelViewCyclicityFirstResponder

    {

        [viewBackAddEvent removeFromSuperview];

        

    }

     

    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-155-6007-1.html
    相关热词搜索:
    下一篇:调用webservice