天天看点

UIView给控件边框加阴影

在文件中选择Build Phases,点开Link Binary With Libraries ,点击添加,关键字添加qua,添加控件

   UIView *v =[[UIViewalloc] initWithFrame:CGRectMake(50,50, 50, 50)];

    v.backgroundColor = [UIColorblackColor];

    v.layer.shadowOpacity =0.8;

    v.layer.shadowOffset =CGSizeMake(5,5);

    v.layer.shadowColor =[UIColororangeColor].CGColor;