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

- (UIView *)lineView{ if (!_lineView) { _lineView = [UIView new]; // _lineView.backgroundColor = UIColorWithRGB(127, 127, 127); _lineView.frame = CGRectMake(, - - - , ); CAShapeLayer *shapeLayer = [CAShapeLayer layer]; [shapeLayer setBounds:_lineView…
分类: UIImageView2013-03-12 17:37 350人阅读 评论(0) 收藏 举报 //UIView -> UIImage #import “QuartzCore/QuartzCore.h” //把UIView 转换成图片 -(UIImage *)getImageFromView:(UIView *)view{ UIGraphicsBeginImageContext(view.bounds.size); [view.layer renderInContext:UIGraphic…
最近工作中,遇到一个需求,需要把一个UIView对象转成UIImage对象显示.经过网络搜索,找到如下答案: ? 1 2 3 4 5 6 7 8 -(UIImage*)convertViewToImage:(UIView*)v{     CGSize s = v.bounds.size;     UIGraphicsBeginImageContext(s);     [v.layer renderInContext:UIGraphicsGetCurrentContext()];     UIIm…
近期工作中,遇到一个需求,须要把一个UIView对象转成UIImage对象显示.经过网络搜索.找到例如以下答案: ? 1 2 3 4 5 6 7 8 -(UIImage*)convertViewToImage:(UIView*)v{    CGSize s = v.bounds.size;    UIGraphicsBeginImageContext(s);    [v.layer renderInContext:UIGraphicsGetCurrentContext()];    UIImag…
有时候layer.cornerRadius并不能满足需求,自己实现drawRect又太麻烦,怎么办? 多的不说,直接上代码: - (void)dwMakeBottomRoundCornerWithRadius:(CGFloat)radius { CGSize size = self.frame.size; CAShapeLayer *shapeLayer = [CAShapeLayer layer]; [shapeLayer setFillColor:[[UIColor whiteColor]…
1.在res/values/目录下 新建文件 attrs.xml <?  xml   version =  "1.0"   encoding =  "utf-8"  ?> <  resources >        < declare-styleable  name  =  "dashedline" >          < attr  name  =  "lineColor"   f…
整理了一个方法,可以直接绘制虚线,下面直接上代码.参数说明已经给出,可直接copy使用 /** ** lineView: 需要绘制成虚线的view ** lineLength: 虚线的宽度 ** lineSpacing: 虚线的间距 ** lineColor: 虚线的颜色 **/ + (void)drawDashLine:(UIView *)lineView lineLength:(int)lineLength lineSpacing:(int)lineSpacing lineColor:(UI…
1,下面是一个利用UIView来给页面上绘制灰色方块的例子,效果图如下:    代码如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 import UIKit   class ViewController: UIViewController {  …
http://blog.csdn.net/coder9999/article/details/7641701 第十二章 使用Quartz和OpenGL绘图 有时应用程序需要能够自定义绘图.一个库是Quartz 2D,她是Core Graphics框架的一部分:另一个库是OpenGL ES,她是跨平台的图形库.OpenGL ES是跨平台图形库OpenGL的简化版.OpenGL ES是OpenGL的一个子集,OpenGL ES是专门为iPhone之类的嵌入式系统(因此缩写字母为“ES”)设计的. 1…
做一个太阳系八大行星的运转动画,不包括行星的卫星,所有行星围绕太阳公转,行星采用纯色,暂时没有自转. 效果静态图: 动画中包括:太阳及各行星,运行轨道,行星公转动画. 先画好草图,设计好大小和位置,根据公转周期计算好动画执行的时间. html的结构: 一个class为solarsys的div,作为太阳系容器元素,该div的position为relative. 行星轨道和行星都用div,position为absolute. 容器用relative和内部元素采用absolute的定位方式,比较简单的…