使用Core Graphics进行绘图
在iOS开发中,Core Graphics是一个强大的绘图框架,它能让开发者绘制各种图形和图像。本文将详细介绍如何使用Core Graphics进行绘图,并对绘图应用进行优化。
实现动作方法
首先,我们需要实现一些动作方法。具体步骤如下:
1. 保存故事板并关闭辅助编辑器,选择 BIDViewController.m 文件。
2. 在文件顶部,现有导入语句下方添加以下代码:
#import "BIDConstants.h"
#import "BIDQuartzFunView.h"
- 找到Xcode为你创建的
changeColor:方法的存根实现,并添加以下代码:
- (IBAction)changeColor:(id)sender {
UISegmentedControl *control = sender;
ColorTabIndex index = [control selectedSegmentIndex];
BIDQuartzFunView *funView = (BIDQuartzFunView *)self.view;
switch (index) {
case kRedColorTab:
funView.currentColor = [UIColor re
超级会员免费看
订阅专栏 解锁全文
299

被折叠的 条评论
为什么被折叠?



