码迷,mamicode.com
首页 >  
搜索关键字:drawrect    ( 392个结果
Drawing a circle
- (void)drawRect:(CGRect)rect { CGFloat lineWidth = 2; CGRect borderRect = CGRectMake(self.frame.size.width/2, self.frame.size.height - 20, 10....
分类:Windows程序   时间:2015-07-15 10:42:21    阅读次数:247
iOS UIView的layoutSubviews和drawRect
UIView的setNeedsDisplay和setNeedsLayout方法。首先两个方法都是异步执行的。setNeedsDisplay会调用自动调用drawRect方法,这样可以拿到UIGraphicsGetCurrentContext,就可以画画了。而setNeedsLayout会默认调用la...
分类:移动开发   时间:2015-07-09 13:08:40    阅读次数:250
iOS下划线/虚线/删除线等等
1.实线,(下划线/删除线) 写一个新类 UnderLineLabel : UILabel - (void)drawRect:(CGRect)rect { // Drawing code [super drawRect:rect]; CGContextRef ctx = UIGraphicsGetCurrentContext(); CGSize f...
分类:移动开发   时间:2015-07-07 11:08:01    阅读次数:253
UIView的layoutSubviews和drawRect方法何时调用
转自:http://jianyu996.blog.163.com/blog/static/112114555201305113018814/首先两个方法都是异步执行。layoutSubviews方便数据计算,drawRect方便视图重绘。layoutSubviews在以下情况下会被调用:1、init...
分类:其他好文   时间:2015-07-04 13:50:58    阅读次数:114
UITableViewCell绘制分割线
第一步: //UITableView去掉自带系统的分割线 _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 第二步: //在自定义的UITableViewCell里重写drawRect:方法 #pragma mark - 绘制Cell分割线 - (v...
分类:其他好文   时间:2015-07-04 11:22:46    阅读次数:251
利用Quartz2D推图的另一个方法 (使用CGMutalePathRef进行分层次)
可以利用 CGMutablePathRef 创建每个不同图形,然后再一起添加到CGContext中- (void)drawRect:(CGRect)rect{ CGContextRef ctx = UIGraphicsGetCurrentContext(); //一、 画线 ...
分类:Web程序   时间:2015-07-02 20:48:18    阅读次数:151
绘制图形-移动,旋转,阴影,渐变
// Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. - (void)drawRect:(CGRect)rect {     UIBezierPath *path = [UI...
分类:移动开发   时间:2015-07-01 22:19:53    阅读次数:259
ios绘图
#import "LCSView.h" @implementation LCSView ////绘图 - (void)drawRect:(CGRect)rect {      #if 0     //图形上下文对象     CGContextRef context = UIGraphicsGetCurrentContext();  ...
分类:移动开发   时间:2015-06-30 18:21:10    阅读次数:221
使用CAShapeLayer与UIBezierPath画出想要的图形
http://blog.csdn.net/volcan1987/article/details/9969455使用CAShapeLayer与UIBezierPath可以实现不在view的drawRect方法中就画出一些想要的图形步骤:1、新建UIBezierPath对象bezierPath2、新建C...
分类:其他好文   时间:2015-06-18 19:22:29    阅读次数:118
iOS开发-UILabel和UIButton添加下划线
关于UILabel和UIButton有的时候需要添加下划线,一般有两种方式通过默认的NSMutableAttributedString设置,第二种就是在drawRect中画一条下划线,本文就简单的选择第一种,第二种有兴趣的可以自己研究一下。UILabel设置下划线: UILabel *labe...
分类:移动开发   时间:2015-06-17 09:23:28    阅读次数:156
392条   上一页 1 ... 25 26 27 28 29 ... 40 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!