画出虚线 4宫格
来源:互联网 发布:xshell同类软件 编辑:程序博客网 时间:2024/06/10 04:24
。h
#import <UIKit/UIKit.h>
#define _WEITH 320/2
#define _HEIGHT 330/2
@interface DetailView :UIView
@end
。m
//
// DetailView.m
// 122CheZhu01
//
// Created by xumin on 7/9/13.
// Copyright (c) 2013 xumin. All rights reserved.
//
#import "DetailView.h"
@implementation DetailView
- (id)initWithFrame:(CGRect)frame
{
self = [superinitWithFrame:frame];
if (self) {
// Initialization code
self.backgroundColor = [UIColorclearColor];
}
return self;
}
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
/*CGContextRef context =UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor);
CGContextBeginPath(context);
CGContextSetLineWidth(context, 2.0);
float lengths[] = {10,10};
CGContextSetLineDash(context, 0, lengths,2);
CGContextMoveToPoint(context, 10.0, 20.0);
CGContextAddLineToPoint(context, 310.0,20.0);
CGContextStrokePath(context);
CGContextClosePath(context); */
CGContextRef context =UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [UIColorblueColor].CGColor);
float lengths[] = {10,10};
CGContextSetLineDash(context, 0, lengths,2);//这是画出的虚线
CGContextMoveToPoint(context,0, _HEIGHT);
CGContextAddLineToPoint(context,320, _HEIGHT);
CGContextSetLineDash(context, 0.0, lengths, 2);
CGContextMoveToPoint(context,0, _HEIGHT);
CGContextAddLineToPoint(context,320, _HEIGHT);
CGContextSetLineDash(context, 0.0, lengths, 2);
CGContextMoveToPoint(context,_WEITH, 0);
CGContextAddLineToPoint(context,_WEITH, self.frame.size.height);
CGContextSetLineDash(context, 0.0, lengths, 2);
CGContextMoveToPoint(context,_WEITH, 0);
CGContextAddLineToPoint(context,_WEITH, self.frame.size.height);
CGContextSetLineDash(context, 0.0, lengths, 2);
CGContextStrokePath(context);
CGContextClosePath(context);
}
@end
- 画出虚线 4宫格
- 如何在Cell里画出虚线?
- PS用圆角矩形工具画出来的是实线而是虚线,哪里出问题了?
- 如何用MFC画出直线、虚线、折线、圆、椭圆、矩形、弧形(附上源码)
- 虚线
- 虚线
- 虚线
- 虚线
- powerdesigner的pdm的relation,即各entry之间的连接线,即表与表之间的关联关系,别人画出来是实线,为什么我画出来是虚线?
- 虚线格 虚线行
- 画出正弦曲线
- flex 线形图为虚线,绘制图例(4)
- 虚线表格
- hr 虚线
- android虚线
- 画虚线
- 显示虚线
- 画虚线
- gdb 调试2
- ubuntu12.04(64位)下编译android4.1.1源码过程
- 雷军同学的1699
- linux C编程规范心得
- x264码率控制概述(2009年8月)
- 画出虚线 4宫格
- 我眼中的技术高手
- Java语言基础
- 黑马程序员C#学习笔记
- uml学习
- android左右手势滑动时与listview中的item事件触发有冲突
- Struts2简单入侵方法
- Myeclipse 10 破解工具 unable to access jarfile *.jar
- 计算机视觉领域的一些牛人博客,超有实力的研究机构等的网站链接