简单绘图
来源:互联网 发布:股票盯盘系统公式 源码 编辑:程序博客网 时间:2024/05/22 13:21
- (void)drawRect:(CGRect)rect { CGContextRef context=UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context,0.2); CGContextBeginPath(context); CGContextMoveToPoint(context, 5, 50); CGContextAddLineToPoint(context,self.frame.size.width-5, 50); CGContextClosePath(context); [[UIColor grayColor] setStroke]; CGContextStrokePath(context);}
再看效果
就这样,一个简单的登录界面就完成了
总结:
1.这个登录界面用到的东西不是很多,主要也就是主要在设计这一块。
2.最后用到了绘图的方法。主要步骤分为以下几点:
```
//获取绘图上下文
CGContextRef context=UIGraphicsGetCurrentContext();
//设置粗细CGContextSetLineWidth(context,0.2);//开始绘图CGContextBeginPath(context);//移动到开始绘图点CGContextMoveToPoint(context, 5, 50);//移动到第二个点CGContextAddLineToPoint(context,self.frame.size.width-5, 50);//关闭路径CGContextClosePath(context);//设置颜色[[UIColor grayColor] setStroke];//绘图CGContextStrokePath(context);
0 0
- 简单绘图
- 简单绘图
- 简单绘图类
- c# GDI+简单绘图
- 第四章、简单绘图
- 四.简单绘图
- MFC 简单绘图
- 2 简单绘图
- wince简单绘图
- c# GDI+简单绘图
- VC中的简单绘图
- c# GDI+简单绘图
- API简单绘图
- API简单绘图2
- API简单绘图3
- mfc-简单绘图
- qt4 简单绘图
- 简单小程序绘图
- 合并 hdfs 文件
- 2015年第六届蓝桥杯C/C++程序设计本科B组省赛 三羊献瑞(结果填空)
- [Leetcode]97. Interleaving String @python
- php 数组元素快速去重
- 使用nodejs,express,mysql,Bootstrap开发采购招标网站(二)主页和注册页面的实现
- 简单绘图
- Android 5.1 以太网服务启动过程
- C++ 蓝桥杯基础训练 10进制转16进制
- "生日悖论"补充
- ZOJ 1003 Crashing Balloon
- C++:泛型编程set(排序去重)
- 手机页面上body不随遮罩层上内容一起滚动
- C++简单例子说明一个问题
- Leetcode 35 - Search Insert Position