ios-改变button四个角的弧度
-(void)createTitleView{
UIView * backview = [[UIView alloc]init];
backview.frame =CGRectMake(87*kHeight, nav.frame.size.height/2-13*kHeight, 146*kWidth, 26*kHeight);
backview.backgroundColor = WhiteColor;
backview.layer.cornerRadius = 5.0;
[nav addSubview:backview]; _btn1 = [com createBtn:@"待接单" andFont:FontOfSize14 andTag:1 and:self action:@selector(pressTitleBtn:) andTitleColor:YellowColor andBorderColor:WhiteColor andBackgroundColor:WhiteColor];
_btn1.selected = YES;
_btn1.frame = CGRectMake(0,0, 73*kWidth, 26*kHeight);
[backview addSubview:_btn1];
UIBezierPath *maskPath1 = [UIBezierPath bezierPathWithRoundedRect:_btn1.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerTopLeft cornerRadii:CGSizeMake(6.0, 6.0)];
CAShapeLayer *maskLayer1 = [[CAShapeLayer alloc] init];
maskLayer1.frame = _btn1.bounds;
maskLayer1.path = maskPath1.CGPath;
_btn1.layer.mask = maskLayer1; _btn2 = [com createBtn:@"已接单" andFont:FontOfSize14 andTag:2 and:self action:@selector(pressTitleBtn:) andTitleColor:WhiteColor andBorderColor:WhiteColor andBackgroundColor:YellowColor];
_btn2.selected = NO;
_btn2.frame = CGRectMake(73*kWidth,0, 72.73*kWidth, 26*kHeight);
UIBezierPath *maskPath2 = [UIBezierPath bezierPathWithRoundedRect:_btn2.bounds byRoundingCorners:UIRectCornerBottomRight | UIRectCornerTopRight cornerRadii:CGSizeMake(6.7, 6.7)];
CAShapeLayer *maskLayer2 = [[CAShapeLayer alloc] init];
maskLayer2.frame = _btn2.bounds;
maskLayer2.path = maskPath2.CGPath;
_btn2.layer.mask = maskLayer2;
[backview addSubview:_btn2]; }
ios-改变button四个角的弧度的更多相关文章
- UWP 改变Button样式
-----some words------ 1.Control:控制 (我们理解成控件) 2.Template:模板 3.Ellipse 椭圆 4.Content 内容 5.Presenter 节目主 ...
- [转]JAVA 根据经纬度算出附近的正方形的四个角的经纬度
csv文件转化为geojson文件中,涉及到路测图的打点生成,打点是由一个个正方形组成,而正方形是由四个点组成的,这四个点根据经纬度和范围生成,具体的实现代码是从网上找来的: /** * * @par ...
- XMPPFrameWork IOS 开发(四)消息和好友上下线
原始地址:XMPPFrameWork IOS 开发(四) 消息 //收到消息 - (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XM ...
- Android 二维码扫描框 加四个角及中间横线自动下滑
红色为加四个角 黄色为扫描线自动下滑 /* * Copyright (C) 2008 ZXing authors * * Licensed under the Apache License, Ver ...
- IOS 改变导航栏返回按钮的标题
IOS 改变导航栏返回按钮的标题 下午又找到了一个新的方法 这个方法不错 暂时没有发现异常的地方. 新写的App中需要使用UINavigationController对各个页面进行导航,但由于第一 ...
- IOS 系统API---NSJSONSerialization四个枚举什么意思
IOS 系统API---NSJSONSerialization四个枚举什么意思 NSJSONReadingMutableContainers:返回可变容器,NSMutableDictionary或NS ...
- unity3d 获取相机视口四个角的坐标
功能:如标题所示,主要考虑用来做3d Plane的自适应屏幕 /// <summary> /// 获取指定距离下相机视口四个角的坐标 /// </summary> /// &l ...
- IOS学习笔记(四)之UITextField和UITextView控件学习
IOS学习笔记(四)之UITextField和UITextView控件学习(博客地址:http://blog.csdn.net/developer_jiangqq) Author:hmjiangqq ...
- 环信 之 iOS 客户端集成四:集成UI
在Podfile文件里加入 pod 'EaseUI', :git => 'https://github.com/easemob/easeui-ios-cocoapods.git' 然后在终端中的 ...
随机推荐
- js总结-面向对象编程,DOM,BOM
- Eclipse Che:下一代基于 Web 的 IDE
即使对于熟练的开发人员,想要去为一个项目贡献代码,正确的安装和配置一个集成开发环境.工作区 workspace和构建工具,都是一个十分艰难和浪费时间的任务.Codenvy 的CEO,Tyler Jew ...
- POJ3184 Ikki's Story I - Road Reconstruction(最大流)
求一次最大流后,分别对所有满流的边的容量+1,然后看是否存在增广路. #include<cstdio> #include<cstring> #include<queue& ...
- 来抢你们IT狗的饭碗了
Java,Html,Css,JavaScript,Jsp啥都不会啊 ,等着我!
- 在ScrollView下加入的组件,不能自动扩展到屏幕高度
ScrollView中的组件设置android:layout_height="fill_parent"不起作用的解决办法 在ScrollView中添加一个android:fillV ...
- iOS 9之适配ATS(转载)
iOS 9系统已经出来了,而网络方面的ATS(App Transport Security)特性可以说每个人都要经历.而我这篇博客,就是结合我最近几天的经历,来谈谈从服务器到iOS客户端对ATS的适配 ...
- 无法将Win7安装到GPT分区下解决办法
当出现"您想将windows安装 在何处时",按shift+F10打开命令提示符,输入:diskpartlist disksel disk 0cleanconvert mbr完成转 ...
- Kafka剖析(一):Kafka背景及架构介绍
http://www.infoq.com/cn/articles/kafka-analysis-part-1/ Kafka是由LinkedIn开发的一个分布式的消息系统,使用Scala编写,它以可水平 ...
- LBS基站数据解析接口
http://www.cellocation.com/interfac/#hybrid http://www.cellid.cn/ https://www.juhe.cn/docs/api/id/8
- python成长之路——第一天
一.python版本间的差异: 1.1:2.x与3.x版本对比 version 2.x 3.x print print " "或者print()打印都可以正常输出 只能print( ...