zoukankan      html  css  js  c++  java
  • iOS常用技术-图片圆角

     1 //
     2 //  ViewController.m
     3 //  图片圆角
     4 //
     5 //  Created by 大欢 on 16/1/20.
     6 //  Copyright © 2016年 bjsxt. All rights reserved.
     7 //
     8 
     9 #import "ViewController.h"
    10 
    11 @interface ViewController ()
    12 
    13 @end
    14 
    15 @implementation ViewController
    16 
    17 - (void)viewDidLoad {
    18     [super viewDidLoad];
    19     
    20     //CALayer:决定UIView样式的类
    21     
    22     UIImage * image = [UIImage imageNamed:@"touxiang.jpg"];
    23     UIImageView * imageView = [[UIImageView alloc] initWithImage:image];
    24     imageView.frame = CGRectMake(100, 100, 100, 100);
    25     
    26     //给图片加圆角
    27 //    imageView.layer.cornerRadius = 50;
    28 //    imageView.layer.masksToBounds = YES;
    29 //    imageView.clipsToBounds = YES;
    30 //    设置边线宽度
    31     imageView.layer.borderWidth = 2;
    32 //    设置边线颜色
    33     imageView.layer.borderColor = [UIColor blackColor].CGColor;
    34     //阴影颜色
    35     imageView.layer.shadowColor = [UIColor redColor].CGColor;
    36     //阴影大小
    37     imageView.layer.shadowOffset = CGSizeMake(10,10);
    38     //不透明度
    39     imageView.layer.shadowOpacity = 0.3;
    40     [self.view addSubview:imageView];
    41 }
    42 
    43 - (void)didReceiveMemoryWarning {
    44     [super didReceiveMemoryWarning];
    45     // Dispose of any resources that can be recreated.
    46 }
    47 
    48 @end


    /********************************************************/

  • 相关阅读:
    Jquery中的this是什么类型
    sorl的schema配置
    vim下常用的命令
    虚拟机克隆
    mysql突然无法连接:the driver has not received any packets from server communications link
    利用DOM的方式点击切换图片及修改文字
    javascript简易日历制作
    markdown数学公式输入指南
    Object.assign()
    引入css的方式
  • 原文地址:https://www.cnblogs.com/MrWuYindi/p/5146667.html
Copyright © 2011-2022 走看看