简单的利用
CoreGraphics
画一个小黄人
话不多说,全在代码里面,挺简单的一个东西
///画身体
void drawBody(CGContextRef context,CGRect rect)
{
///设置颜色
[[UIColor yellowColor] set];
CGFloat startX = 100;
CGFloat star...
分类:
其他好文 时间:
2015-06-10 17:30:34
阅读次数:
145
//弹出时的动画-(void)addAnimation : (CGRect )sortFrame{ pBookSortView.alpha=0; pBookSortView.transform=CGAffineTransformMakeScale(0.02, 0.02); ...
分类:
其他好文 时间:
2015-06-10 13:43:49
阅读次数:
93
UIView/UIWindow/UIScreen/CALayer1、UIScreen可以获取设备屏幕的大小。1234567// 整个屏幕的大小 {{0, 0}, {320, 480}}CGRect bounds = [UIScreen mainScreen].bounds;NSLog(@"UIScr...
分类:
移动开发 时间:
2015-06-09 23:17:41
阅读次数:
280
有时候需要修改导航栏的高度,可以这样修改:
UINavigationBar *bar = [self.navigationController navigationBar];
CGFloat navBarHeight =
30.0f;
CGRect rect = CGRectMake(0,
20, self.window.frame.size...
分类:
移动开发 时间:
2015-06-09 17:34:55
阅读次数:
129
//根据一个矩形画曲线+ (UIBezierPath*)bezierPathWithRect:(CGRect)rect//根据矩形框的内切圆画曲线+ (UIBezierPath*)bezierPathWithOvalInRect:(CGRect)rect//根据矩形画带圆角的曲线+ (UIBezie...
分类:
其他好文 时间:
2015-06-01 16:05:57
阅读次数:
95
//截图UIView:截全图-(UIImage*)captureView:(UIView *)theView{ CGRect rect = theView.frame; if ([theView isKindOfClass:[UIScrollView class]]) { ...
分类:
移动开发 时间:
2015-05-31 18:15:07
阅读次数:
197
我用的是Xcode6.2. 系统默认没有pch文件。 所以没有自动导入UIKit包。我在继承NSObject类里也不能用CGRect或者UI开头的控件,原因也是Xcode6.2以后版本缺少UIKit 框架,引入框架就可以用了在你的XXXXX.h 文件里面 导入#import
分类:
其他好文 时间:
2015-05-28 22:50:07
阅读次数:
169
XCODE UITextField 中的属性和用法 一些基本的用法UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; CGRect frame =CGRectMake(110, 100, 100, 30); .....
分类:
其他好文 时间:
2015-05-28 19:53:11
阅读次数:
143
UIView:- (void)drawRect:(CGRect)rect { [super drawRect:rect]; CGRect frame = CGRectMake(50, 100, 100, 100); /*画填充圆 */ CGContextRef...
分类:
移动开发 时间:
2015-05-27 13:47:14
阅读次数:
614
mark for myself.
以下为自己开发过程中遇到并使用到的一些方法。更多的学习笔记以后用到同步更新。
//自适应高度:
- (void)webViewDidFinishLoad:(UIWebView *)webView {
CGRect frame = webView.frame;
CGSize fittingSize = [webView sizeT...
分类:
移动开发 时间:
2015-05-26 21:25:31
阅读次数:
129