iOS基本图形绘制--UIBezierPath
2016-05-15 20:01
411 查看
BasicGraphics
iOS基本图形绘制, 包括: 线, 弧线, 三角形, 椭圆, 矩形, 圆角矩形, 贝塞尔曲线等. 效果如下图:UIBezierPath
官方参考: UIBezierPath工程剽窃自: [iPhone] UIBezierPath 図形の描画 (Objective-C)
可以创建的UIBezierPath对象有:
+ bezierPath + bezierPathWithRect: + bezierPathWithOvalInRect: + bezierPathWithRoundedRect:cornerRadius: + bezierPathWithRoundedRect:byRoundingCorners:cornerRadii: + bezierPathWithArcCenter:radius:startAngle:endAngle:clockwise: + bezierPathWithCGPath: - bezierPathByReversingPath
CoreGraphics
这是另一种更加底层的绘制方法.深色背景下设置标题栏为白色
背景色为黑色, 需设置状态栏(显示信号, 时间, 电量等)为亮色, 有两种方法:Info.plist添加View controller-based status bar appearance, 设置value为NO. 添加
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
ViewController.m中实现 - (UIStatusBarStyle) preferredStatusBarStyle 方法
- (UIStatusBarStyle) preferredStatusBarStyle { return UIStatusBarStyleLightContent; }
并且在ViewController.m中调用此方法.
[self preferredStatusBarStyle];
(注意删掉Info.plist中的View controller-based status bar appearance项)
Github
BasicGraphics相关文章推荐
- android UI——2D绘图绘制几何图形
- 给UILabel 或者 UIButton标题加下划线
- 在spark中使用Hive报错error: not found: value sqlContext
- JSP内置对象--request对象
- iOS开发系列--UITableView全面解析
- 按钮添加活动指示器
- 关于hibernate中的错误:Exception in thread "main" org.hibernate.hql.internal.ast.QuerySyntaxException: tb_e
- poj 1141 Brackets Sequence
- POJ 1141 Brackets Sequence
- 国防科大校赛决赛-final(镜像赛) Problem A: XueXX and P-P String
- 国防科大校赛决赛-final(镜像赛) Problem C: XueXX and Chessboard
- 国防科大校赛决赛-final(镜像赛) Problem B: XueXX and Binary
- Burp Suite使用详解
- 使用 Equinox 开发 OSGi 应用程序
- poj 1458 Common Subsequence
- 【LeetCode】95. Unique Binary Search Trees II
- Java源码学习 -- java.lang.StringBuilder,java.lang.StringBuffer,java.lang.AbstractStringBuilder
- php中include()和require()的区别
- LeetCode 60. Permutation Sequence
- 在Android Studio中进行单元测试和UI