首页
科技
登录
6mi
u
盘
搜
搜 索
科技
设置UIButton一侧圆角
设置UIButton一侧圆角
it
2026-02-09
2
UIButton * button =[
UIButton buttonWithType:
UIButtonTypeSystem]; [
self.view addSubview:button];
//一定要先添加到视图上 button.frame=
CGRectMake(
100,
100,
100,
40); button.backgroundColor=[
UIColor blueColor];
UIBezierPath *maskPath=[
UIBezierPath bezierPathWithRoundedRect:button.bounds byRoundingCorners:
UIRectCornerTopRight|
UIRectCornerBottomRight cornerRadii:
CGSizeMake(
10,
10)];
CAShapeLayer *maskLayer=[[
CAShapeLayer alloc]init]; maskLayer.frame=button.bounds; maskLayer.path=maskPath.CGPath; button.layer.mask=maskLayer;
转载于:https://www.cnblogs.com/akiha/p/6526783.html
相关资源:数据结构—成绩单生成器
转载请注明原文地址: https://win8.8miu.com/read-1555671.html
最新回复
(
0
)