uiview 单边圆角或者单边框

UIView *view2 = [[UIView alloc] initWithFrame:CGRectMake(120, 10, 80, 80)]; view2.backgroundColor = [UIColor redColor]; [self.view addSubview:view2]; UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:view2.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)]; CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; maskLayer.frame = view2.bounds; maskLayer.path = maskPath.CGPath; view2.layer.mask = maskLayer;

时间: 2024-08-14 07:49:17

uiview 单边圆角或者单边框的相关文章

iOS UIView设置圆角

UIView设置圆角 1.比较简单的情况,UIView四个角都是圆角: UIView *aView = [[UIView alloc] init]; aView.frame = CGRectMake(0, 0, 300, 200); aView.backgroundColor = [UIColor redColor]; //设置圆角边框 aView.layer.cornerRadius = 8; aView.layer.masksToBounds = YES; //设置边框及边框颜色 aView

android圆角矩形有边框无背景色

我们经常要用到圆角矩形,这也是现在的流行的样式..但是今天在工作中,遇到要写圆角矩形有边框但无背景色的button,本来想让妹子帮忙切图的,但是不想麻烦妹子,自己撑着,说可以做,结果弄了老半天菜搞定的,现在给大家看看,以后避免这麻烦...() <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/and

给图片设置圆角和圆形边框,添加点击事件

//1.创建图片 _userImage = [[UIImageView alloc]init]; //2.设置图片圆角 _userImage.layer.cornerRadius = 33; _userImage.layer.masksToBounds = YES; //3.设置圆形边框 CALayer *layer = [_userImage layer]; layer.borderColor = [[UIColor whiteColor] CGColor]; layer.borderWidt

巧妙实现带圆角的渐变边框

如何实现下面这个渐变的边框效果: 这个问题本身不难,实现的方法也有一些,主要是有一些细节需要注意. border-image border-image 是 CSS 规范 CSS Backgrounds and Borders Module Level 3 (最新一版的关于 background 和 border 的官方规范) 新增的一个属性值. 顾名思义,我们可以给 border 元素添加 image,类似于 background-image,可以是图片也可以是渐变,不再局限于纯色. 使用 bo

UIView设置圆角

1.比较简单的情况,UIView四个角都是圆角: UIView *aView = [[UIView alloc] init]; aView.frame = CGRectMake(0, 0, 300, 200); aView.backgroundColor = [UIColor redColor]; //设置圆角边框 aView.layer.cornerRadius = 8; aView.layer.masksToBounds = YES; //设置边框及边框颜色 aView.layer.bord

[iOS6]如何在Xcode6设置UIView的圆角显示

很多人都有把按钮做成圆角的需求,以前我们会在代码中加入如下代码实现这个功能: mainImgView.layer.cornerRadius = 6; 现在Xcode6加了 RunTime Attributes 的特性之后,我们可以直接在Xcode中设置: 这样运行之后就会显示圆角的效果了:

Java 图片设置圆角(设置边框,旁白)

/** * 图片设置圆角 * @param srcImage * @param radius * @param border * @param padding * @return * @throws IOException */ public static BufferedImage setRadius(BufferedImage srcImage, int radius, int border, int padding) throws IOException{ int width = srcI

legend生成表单边框效果

<form> <fieldset> <legend>健康信息</legend> 身高:<input type="text" /> 体重:<input type="text" /> </fieldset></form> 原文地址:https://www.cnblogs.com/webwangjie/p/10530930.html

iOS自定义年月日

// // JackDateAndDateView.m // ZHB // // Created by JackRen on 16/5/10. // Copyright © 2016年 atense. All rights reserved. // #import "JackDateAndDateView.h" #import "UIView+Common.h" #define NUMBERS @"0123456789" #define BUTT