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));
        
        

  • 相关阅读:
    bbs树形打印(一)
    ORM
    kafka的分区
    Content-type"是"application/json的作用
    idea增强for循环
    rabbitmq的发布订阅
    搭建mqtt服务器apollo
    kafka生产者集群和分区,消费者轮询接收
    http实时推送技术
    Kafka:Configured broker.id 2 doesn't match stored broker.id 0 in meta.properties.
  • 原文地址:https://www.cnblogs.com/-ios/p/4672944.html
Copyright © 2011-2022 走看看