zoukankan      html  css  js  c++  java
  • 只在左边和右边加圆角

    设置控件圆角,只设置上面两个角的圆角(任意角)

    http://blog.csdn.net/shuilanjuedemaomn/article/details/45644529

    代码(通过贝塞尔曲线重绘layer层)

      1. UIImageView *picImageView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];  
      2.     picImageView.backgroundColor = [UIColor greenColor];  
      3.     [self.view addSubview:picImageView];  
      4.       
      5.     UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:picImageView.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight cornerRadii:CGSizeMake(10, 10)]; // UIRectCornerBottomRight通过这个设置  
      6.       
      7.     CAShapeLayer *maskLayer = [CAShapeLayer layer];  
      8.     maskLayer.frame = picImageView.bounds;  
      9.     maskLayer.path = maskPath.CGPath;  
      10.       
      11.     picImageView.layer.mask = maskLayer; 
  • 相关阅读:
    贪心算法
    分治法
    递归法
    查找二 树与图的搜索
    (转载)查找三 哈希表的查找
    (转载)查找一 线性表的查找
    4.写出完整版的strcpy函数
    3.strcpy使用注意(3)
    2.strcpy使用注意(2)
    1.strcpy使用注意
  • 原文地址:https://www.cnblogs.com/tufei7/p/7843799.html
Copyright © 2011-2022 走看看