• 悬浮按钮


    @property(strong,nonatomic)UIWindow *window;

    @property(strong,nonatomic)UIButton *FloatBtn;

       _FloatBtn = [UIButton buttonWithType:UIButtonTypeCustom];

        [_FloatBtn setTitle:@"发布需求" forState:UIControlStateNormal];

        _FloatBtn.titleLabel.font = [UIFont fontWithName:@"Arial" size:12];

        _FloatBtn.frame = CGRectMake(0, 0, 60, 60);

        [_FloatBtn addTarget:self action:@selector(resignWindow) forControlEvents:UIControlEventTouchUpInside];

        

        _window = [[UIWindow alloc]initWithFrame:CGRectMake(SCREENWIDTH-90, SCREENHEIGHT-100, 60, 60)];

        _window.windowLevel = UIWindowLevelAlert+1;

        _window.backgroundColor = [UIColor colorwithHexString:@"#9d8a84"];

        _window.layer.borderWidth = 0.2;

        _window.layer.borderColor=[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.6].CGColor;

        //阴影的颜色

        _window.layer.shadowColor = [[UIColor blackColor] CGColor];

        _window.layer.shadowOffset = CGSizeMake(3, 3);

    //

    ////    _window.layer.backgroundColor=[UIColor blackColor].CGColor;

        _window.layer.shadowColor=[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.6].CGColor;

        _window.layer.shadowRadius=5;

    ////    _window.layer.shadowOffset=CGSizeMake(1, 1);

        _window.layer.shadowOpacity=0.3;

        

        _window.layer.cornerRadius = 30;

        _window.layer.masksToBounds = YES;

        [_window addSubview:_FloatBtn];

        [_window makeKeyAndVisible];//关键语句,显示window

    /**

     *  关闭悬浮的window

     */

    - (void)resignWindow

    {

        

        [_window resignKeyWindow];

        [_window setHidden:YES];

        _window = nil;

        //跳转页面

        DistrubuteViewController *dis = [[DistrubuteViewController alloc]init];

        [self.navigationController pushViewController:dis animated:YES];

        

    }

  • 相关阅读:
    nexus2设置开机自启
    谷粒商城XXL-SSO(三十六)
    谷粒商城SpringSession(三十五)
    CDH安装(二)
    CDH安装(一)
    大数据服务规划
    ClouderaManager的背景和介绍
    大数据架构
    C++ const成员变量和成员函数(常成员函数)
    C++ this指针详解(精辟)
  • 原文地址:https://www.cnblogs.com/liaolijun/p/5486359.html
Copyright © 2020-2023  润新知