zoukankan      html  css  js  c++  java
  • UIView设置部分圆角---iOS开发UI篇

        UIView *view = [UIView new];
        view.frame = CGRectMake(100, 100, 300, 100);
        [self.view addSubview:view];
        view.backgroundColor = [UIColor orangeColor];
        
        UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:view.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomRight cornerRadii:CGSizeMake(15, 15)];
        CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
        maskLayer.frame = view.bounds;
        maskLayer.path = maskPath.CGPath;
        view.layer.mask = maskLayer;
    

      效果图如下:

  • 相关阅读:
    Celery
    高并发架构
    websocket
    git分支管理
    auto_ptr与shared_ptr
    UDP信号驱动IO
    TCP带外数据
    UDP广播
    获取mac地址
    char数组初始化
  • 原文地址:https://www.cnblogs.com/TheYouth/p/9303933.html
Copyright © 2011-2022 走看看