1
그래서 ... 나는이 앱을 사용하여 모양을 그린 다음 사용자가 색상을 지정할 수 있습니다. 나는 4 개의 도형을 가진 tabbar를 만들었고 하나가 클릭되면 각각의 도형이 그려진다. 나는 quartzDemo에서 그림 그리기 아이디어를 가져 갔다. 그래서 모양이 일반 클래스이고 그 다음 shape_name 하위 클래스가 있습니다. Square의 코드는 다음과 같습니다. 모양이 컬러 메뉴를 도청코어 그래픽 색상 컨텍스트
@implementation Square
- (void)drawInContext:(CGContextRef)context {
CGContextSetRGBStrokeColor(context, 0.0, 0.0, 0.0, 1.0);
CGContextSetLineWidth(context, 1.0);
CGContextBeginPath(context);
CGContextMoveToPoint(context, 1, 1);
CGContextAddLineToPoint(context, 1, 79);
CGContextAddLineToPoint(context, 79, 79);
CGContextAddLineToPoint(context, 79, 1);
CGContextAddLineToPoint(context, 1, 1);
CGContextClosePath(context);
CGContextStrokePath(context);
}
@end
가 나타나고 나는 메뉴에서 버튼을 탭하면 색상을 변경하고 싶습니다. 어떻게해야합니까?
Ty 미리.
그 이유는 ... –