MBProgressHUD-Determinated Mode重绘代码.
来源:互联网 发布:开源cms系统 php商城 编辑:程序博客网 时间:2024/06/06 00:14
- (void)drawRect:(CGRect)rect{ CGContextRef context = UIGraphicsGetCurrentContext(); CGFloat lineWidth = 2.f; CGRect allRect = self.bounds; CGRect circleRect = CGRectInset(allRect, lineWidth/2.f, lineWidth/2.f); CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)); [[UIColor yellowColor] setStroke];// [[UIColor redColor] setFill]; CGContextSetLineWidth(context, lineWidth); CGContextStrokeEllipseInRect(context, circleRect); // 90 degrees CGFloat startAngle = - ((float)M_PI / 2.f); UIBezierPath *processPath = [UIBezierPath bezierPath]; processPath.lineCapStyle = kCGLineCapButt; processPath.lineWidth = lineWidth * 2.f; CGFloat radius = (CGRectGetWidth(self.bounds) / 2.f) - (processPath.lineWidth / 2.f); CGFloat endAngle = (0.01 * 2.f * (float)M_PI) + startAngle; [processPath addArcWithCenter:center radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES]; // Ensure that we don't get color overlaping when _progressTintColor alpha < 1.f. CGContextSetBlendMode(context, kCGBlendModeCopy); [[UIColor redColor] set]; [processPath stroke];}
阅读全文
0 0
- MBProgressHUD-Determinated Mode重绘代码.
- 【代码笔记】iOS-MBProgressHUD
- 自己修改的MBProgressHUD 代码
- 【代码笔记】iOS-MBProgressHUD+MJ
- 【代码笔记】iOS-MBProgressHUD-Demo
- MBProgressHUD
- MBProgressHUD
- MBProgressHUD
- MBProgressHUD
- MBProgressHUD
- MBProgressHUD
- MBProgressHUD
- MBProgressHUD
- MBProgressHUD
- MBProgressHUD
- MBProgressHUD
- MBProgressHUD
- MBProgressHUD
- 公告栏对话框管理(课堂笔记)
- PID校正仿真分析
- windows网络编程之重叠模型(OVERLAPPED I/O)基础知识
- mac os 安装thrift
- 手机如何扫描识别车牌
- MBProgressHUD-Determinated Mode重绘代码.
- uva 272
- Android开发之Canvas及高级使用
- 面向对象
- python写算法题:leetcode: 15. 3Sum
- Jquery实现回到顶部
- JAVA中子类与父类相互转换
- 解决MAVEN web工程的版本问题
- python-03