- (UIView *)lineView{

    if (!_lineView) {

        _lineView = [UIView new];
// _lineView.backgroundColor = UIColorWithRGB(127, 127, 127);
_lineView.frame = CGRectMake(, 13.5 + 5.5 , totalWith / - - - , ); CAShapeLayer *shapeLayer = [CAShapeLayer layer];
[shapeLayer setBounds:_lineView.bounds];
[shapeLayer setPosition:CGPointMake(CGRectGetWidth(_lineView.frame) / , CGRectGetHeight(_lineView.frame))];
[shapeLayer setFillColor:UIColorWithRGB(, , ).CGColor];
// 设置虚线颜色为blackColor
[shapeLayer setStrokeColor:UIColorWithRGB(, , ).CGColor];
// 设置虚线宽度
[shapeLayer setLineWidth:CGRectGetHeight(_lineView.frame)];
[shapeLayer setLineJoin:kCALineJoinRound];
// 设置线宽,线间距
[shapeLayer setLineDashPattern:[NSArray arrayWithObjects:[NSNumber numberWithInt:], [NSNumber numberWithInt:], nil]];
// 设置路径
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, , );
CGPathAddLineToPoint(path, NULL, CGRectGetWidth(_lineView.frame), );
[shapeLayer setPath:path];
CGPathRelease(path);
// 把绘制好的虚线添加上来
[_lineView.layer addSublayer:shapeLayer]; } return _lineView;
}

复制文本

- (UIView *)fuzhi {
if (_fuzhi == nil) {
_fuzhi = [[UIView alloc] init];
_fuzhi.frame = CGRectMake(ScreenWidth / , CGRectGetMinY(self.jubao.frame), ScreenWidth / , CGRectGetHeight(self.content.frame) / - ); _fuzhi.center = CGPointMake(ScreenWidth * / , _fuzhi.centerY); UIImageView *image = [[UIImageView alloc] init];
image.frame = CGRectMake(, , CGRectGetWidth(_fuzhi.frame) - , CGRectGetWidth(_fuzhi.frame) - );
image.image = [UIImage imageNamed:@"复制icon"];
[_fuzhi addSubview:image]; UILabel *label = [[UILabel alloc] init];
label.frame = CGRectMake(, CGRectGetMaxY(image.frame), CGRectGetWidth(image.frame), );
label.text = @"复制";
label.textColor = [UIColor lightGrayColor];
[_fuzhi addSubview:label];
label.center = CGPointMake(image.centerX, label.centerY);
label.textAlignment = NSTextAlignmentCenter;
label.font = [UIFont systemFontOfSize:]; UITapGestureRecognizer *tap =[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fzClick)];
[_fuzhi addGestureRecognizer:tap];
}
return _fuzhi;
}
-(void)fzClick
{
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
pasteboard.string = _model.Content;
[SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark]; [SVProgressHUD setMinimumDismissTimeInterval:];
[SVProgressHUD showSuccessWithStatus:@"复制成功"]; }

将UIview描画成虚线等.的更多相关文章

  1. 将UIView转成UIImage,将UIImage转成PNG/JPG

    分类: UIImageView2013-03-12 17:37 350人阅读 评论(0) 收藏 举报 //UIView -> UIImage #import “QuartzCore/Quartz ...

  2. 如何把UIView转成UIImage,解决模糊失真问题

    最近工作中,遇到一个需求,需要把一个UIView对象转成UIImage对象显示.经过网络搜索,找到如下答案: ? 1 2 3 4 5 6 7 8 -(UIImage*)convertViewToIma ...

  3. 把UIView转成UIImage,解决模糊失真问题

    近期工作中,遇到一个需求,须要把一个UIView对象转成UIImage对象显示.经过网络搜索.找到例如以下答案: ? 1 2 3 4 5 6 7 8 -(UIImage*)convertViewToI ...

  4. 教你把UIView切成任意形状

    有时候layer.cornerRadius并不能满足需求,自己实现drawRect又太麻烦,怎么办? 多的不说,直接上代码: - (void)dwMakeBottomRoundCornerWithRa ...

  5. android自定义View---生成虚线的View

    1.在res/values/目录下 新建文件 attrs.xml <?  xml   version =  "1.0"   encoding =  "utf-8&q ...

  6. 画虚线 iOS

    整理了一个方法,可以直接绘制虚线,下面直接上代码.参数说明已经给出,可直接copy使用 /** ** lineView: 需要绘制成虚线的view ** lineLength: 虚线的宽度 ** li ...

  7. Swift - 使用UIView给页面添加4×4方格

    1,下面是一个利用UIView来给页面上绘制灰色方块的例子,效果图如下:    代码如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ...

  8. iOS 使用Quartz和OpenGL绘图

    http://blog.csdn.net/coder9999/article/details/7641701 第十二章 使用Quartz和OpenGL绘图 有时应用程序需要能够自定义绘图.一个库是Qu ...

  9. html+ccs3太阳系行星运转动画

    做一个太阳系八大行星的运转动画,不包括行星的卫星,所有行星围绕太阳公转,行星采用纯色,暂时没有自转. 效果静态图: 动画中包括:太阳及各行星,运行轨道,行星公转动画. 先画好草图,设计好大小和位置,根 ...

随机推荐

  1. MySQL学习笔记十六:锁机制

    1.数据库锁就是为了保证数据库数据的一致性在一个共享资源被并发访问时使得数据访问顺序化的机制.MySQL数据库的锁机制比较独特,支持不同的存储引擎使用不同的锁机制. 2.MySQL使用了三种类型的锁机 ...

  2. Linux随笔之——./configure、make、make install(转)

    原文连接:http://www.linuxidc.com/Linux/2011-02/32211.htm 这些都是典型的使用GNU的AUTOCONF和AUTOMAKE产生的程序的安装步骤. ./con ...

  3. C算法编程题(六)串的处理

    前言 上一篇<C算法编程题(五)“E”的变换> 连续写了几篇有关图形输出的编程题,今天说下有关字符串的处理. 程序描述 在实际的开发工作中,对字符串的处理是最常见的编程任务.本题目即是要求 ...

  4. CodeIgniter-Lottery - php ci 抽奖辅助函数

    CodeIgniter-Lottery - php ci 抽奖辅助函数 Github https://github.com/xjnotxj/CodeIgniter-Lottery 用法 1. 移入文件 ...

  5. Android之圆形头像裁切

    PS:今天项目测试组发现,百度地图定位的数据坐标位置是正确的,但是显示的数据是错误的.最后查来查去发现,那个商厦在百度地图上根本就没有那条数据,这让我如何显示,当初就推崇使用高德地图定位,上面的数据量 ...

  6. RabbitMQ原理与相关操作(二)

    接着 上篇随笔 增加几个概念: RabbitMQ是一个在AMQP(高级消息队列协议)标准基础上完整的,可服用的企业消息系统. AMQP模型的功能组件图(上图摘自 Sophia_tj 的 第2章 AMQ ...

  7. 《C#并发编程经典实例》笔记

    1.前言 2.开宗明义 3.开发原则和要点 (1)并发编程概述 (2)异步编程基础 (3)并行开发的基础 (4)测试技巧 (5)集合 (6)函数式OOP (7)同步 1.前言 最近趁着项目的一段平稳期 ...

  8. 7.8 数据注解特性--Column

    Column特性可以用到类的属性中,Code-First默认的约定是使用属性名称作为列名.这个Column特性可以打破这个特性. 看下面的代码: using System; using System. ...

  9. Genesis2000用c#开发外挂

    先上官方的说明 gateway is a command line utility for sending messages and commands to Genesis processes. Th ...

  10. 基于.net mvc 的供应链管理系统(YB-SCM)开发随笔

    作为园子里的伪新人,经常拜读众位大牛的帖子,一直有写点东西的想法. 今天终于下定决心去写这个系统的开发过程,由于本人文笔有限,不足之处多多海涵.