-(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四个角的弧度的更多相关文章

  1. UWP 改变Button样式

    -----some words------ 1.Control:控制 (我们理解成控件) 2.Template:模板 3.Ellipse 椭圆 4.Content 内容 5.Presenter 节目主 ...

  2. [转]JAVA 根据经纬度算出附近的正方形的四个角的经纬度

    csv文件转化为geojson文件中,涉及到路测图的打点生成,打点是由一个个正方形组成,而正方形是由四个点组成的,这四个点根据经纬度和范围生成,具体的实现代码是从网上找来的: /** * * @par ...

  3. XMPPFrameWork IOS 开发(四)消息和好友上下线

    原始地址:XMPPFrameWork IOS 开发(四) 消息 //收到消息 - (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XM ...

  4. Android 二维码扫描框 加四个角及中间横线自动下滑

    红色为加四个角  黄色为扫描线自动下滑 /* * Copyright (C) 2008 ZXing authors * * Licensed under the Apache License, Ver ...

  5. IOS 改变导航栏返回按钮的标题

    IOS 改变导航栏返回按钮的标题   下午又找到了一个新的方法 这个方法不错 暂时没有发现异常的地方. 新写的App中需要使用UINavigationController对各个页面进行导航,但由于第一 ...

  6. IOS 系统API---NSJSONSerialization四个枚举什么意思

    IOS 系统API---NSJSONSerialization四个枚举什么意思 NSJSONReadingMutableContainers:返回可变容器,NSMutableDictionary或NS ...

  7. unity3d 获取相机视口四个角的坐标

    功能:如标题所示,主要考虑用来做3d Plane的自适应屏幕 /// <summary> /// 获取指定距离下相机视口四个角的坐标 /// </summary> /// &l ...

  8. IOS学习笔记(四)之UITextField和UITextView控件学习

    IOS学习笔记(四)之UITextField和UITextView控件学习(博客地址:http://blog.csdn.net/developer_jiangqq) Author:hmjiangqq ...

  9. 环信 之 iOS 客户端集成四:集成UI

    在Podfile文件里加入 pod 'EaseUI', :git => 'https://github.com/easemob/easeui-ios-cocoapods.git' 然后在终端中的 ...

随机推荐

  1. Java数组课后作业

    1.运行TestArrays.java,了解Arrays中的一些重要方法的用法. Arrays.equals(a 1, a2):判断数组是否相等. int[] b = Arrays.copyOf(a, ...

  2. Eclipse Che:下一代基于 Web 的 IDE

    即使对于熟练的开发人员,想要去为一个项目贡献代码,正确的安装和配置一个集成开发环境.工作区 workspace和构建工具,都是一个十分艰难和浪费时间的任务.Codenvy 的CEO,Tyler Jew ...

  3. Java 语言细节

    1.  if(x = 1) 为什么java不会因为这样的笔误代码犯错?  // meant x == 1 因为在C++中,整数0代表布尔值false,非0值相当于布尔值true,在Java中int与布 ...

  4. BestCoder#15 A-LOVE(暴力)

    Love Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

  5. java 程序访问hdfs错误 hadoop2.2.0

    很奇怪的问题,程序在eclipse上跑没问题: 这就代码:FileSystem fs = FileSystem.get(URI.create(hdfs_file),  conf , "use ...

  6. node.js 实现一个简单的登录拦截器

    拦截器在web开发中随处可见,比如站点的管理后台,不说所有人都能进入,所以就需要做一个拦截器并友好的跳转到提示页. 下面我们简单实现一种,判断用户是否登录成功,登录不成功的用户自动重定向到登录页面. ...

  7. float了的元素和内联元素不支持margin:auto

    float了的元素和内联元素不支持margin:auto

  8. div基础

    1. 写在后面的样式优于前面,会把前面的覆盖掉! 2.三角形的造法:width:0; height:0;然后设置border-left   border-right  border-top  bord ...

  9. Codeforces Round #251 (Div. 2) C. Devu and Partitioning of the Array

    注意p的边界情况,p为0,或者 p为k 奇数+偶数 = 奇数 奇数+奇数 = 偶数 #include <iostream> #include <vector> #include ...

  10. Codeforces Round #248 (Div. 2) A. Kitahara Haruki's Gift

    解决思路是统计100的个数为cnt1,200的个数为cnt2 则 cnt1    cnt2 奇数      奇数 奇数      偶数 偶数      奇数 偶数     偶数 当cnt1为奇数时一定 ...