UI控件:
设按钮标题:[but SetTitle @"" forState:UIControlStateNormal]; //注,好懒的设计,无语
旋转:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
return (interfaceOrientation == UIInterfaceOrientationPortrait ||
interfaceOrientation == UIInterfaceOrientationLandScapeLeft);
}
绘图API:
-
(
void
)
drawRect
:(
CGRect
)
rect
{
CGContextRef
bluecontext
=
UIGraphicsGetCurrentContext
();
CGContextSetLineWidth
(
bluecontext
,
2.0
);
CGContextSetStrokeColorWithColor
(
bluecontext
,
[
UIColor
blueColor
].
CGColor
);
CGContextMoveToPoint
(
bluecontext
,
1
,
1
);
CGContextAddLineToPoint
(
bluecontext
,
100
,
100
);
CGContextSetStrokeColorWithColor
(
bluecontext
,
[
UIColor
redColor
].
CGColor
);
CGContextAddLineToPoint
(
bluecontext
,
200
,
100
);
CGContextStrokePath
(
bluecontext
);
}
类:
连接口 (IBOutlet)
连接方法 -(IBAction)