zoukankan      html  css  js  c++  java
  • 和layer有关的东西

     self.myView=[[UIView alloc]initWithFrame:CGRectMake(50, 50, 200, 200)];
        self.myView.backgroundColor=[UIColor redColor];
        [self.view addSubview:self.myView];
        
        //加一张图片
        UIImageView *imv=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"3.png"]];
        imv.frame=self.myView.bounds;
        [self.myView addSubview:imv];
        
        //设置圆角
        self.myView.layer.cornerRadius=25;
        //描边粗细
        self.myView.layer.borderWidth=20;
        //描边颜色(需要装换类型 后面加.CGcolor)
        self.myView.layer.borderColor=[UIColor cyanColor].CGColor;
        //阴影颜色
        self.myView.layer.shadowColor=[UIColor orangeColor].CGColor;
        //阴影偏移
        self.myView.layer.shadowOffset=CGSizeMake(10, 10);
        //阴影透明度(是必须设置的)
        self.myView.layer.shadowOpacity=0.5;
        //模糊程度(阴影的模糊程度)
        self.myView.layer.shadowRadius=10;
        
        
        
        
        //设置锚点
        self.myView.layer.anchorPoint=CGPointMake(0.5, 0.5);
        
        //打印position
        NSLog(@"position:%@",NSStringFromCGPoint(self.myView.layer.position));
        //打印锚点
        NSLog(@"锚点:%@",NSStringFromCGPoint(self.myView.layer.anchorPoint));
        
        

  • 相关阅读:
    fork安全的gettid高效实现
    TCP_DEFER_ACCEPT的坑
    TCP Linger的坑
    Blade和其他构建工具有什么不同
    在Blade中结合gperftools检查内存泄露
    GraphViz web版
    用户场景分析
    java-二维数组——with 刘童格
    java-四则运算-五-网页版--with刘童格
    java-四则运算-四
  • 原文地址:https://www.cnblogs.com/-ios/p/4672944.html
Copyright © 2011-2022 走看看