共 383 篇文章 |
|
假如我们用Xcode新建一个View-based Application,在ViewController.m中加上- (void) loadView { NSLog(@"loadView Called");}loadView在每一次使用self.view这个property,并且self.view为nil的时候被调用,用以产生一个有效的self.view。loadView仅仅应该在开发者希望自行通过编码而不是Interface Builder定制view的时候被实现,而... 阅30 转0 评0 公众公开 15-02-03 08:56 |
键盘的显示/隐藏应用中,跟用户交互功能必不可少![[NSNotificationCenter defaultCenter] addObserver:selfselector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];float animationDuration = [[[notification userInfo]valueForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue];让键盘显示时,让... 阅159 转1 评0 公众公开 15-01-30 20:48 |
阅226 转0 评0 公众公开 15-01-30 20:05 |
给UIButton里面的文本文字加shadow 给UIButton里面的文本文字加shadow.UIButton *btnSend=[UIButton buttonWithType:UIButtonTypeCustom];[btnSend setTitleShadowColor:[UIColor redColor] forState:UIControlStateNormal];如果把[btnSendsetTitleShadowColor:[UIColor redColor]forState:UIControlStateNormal];换成 [btnSend.titleLabel se... 阅272 转1 评0 公众公开 15-01-30 20:00 |
去掉UIActionSheet第一个按钮红色。shareSheet =[[UIActionSheetalloc]initWithTitle:@"邮件转发"shareSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;[shareSheet addButtonWithTitle:@"短信转发"];[shareSheet addButtonWithTitle:@"邮件转发"];[shareSheetaddButtonWithTitle:@"取消"];a... 阅455 转0 评0 公众公开 15-01-30 19:58 |
CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"transform.translation.y"];CAAnimationGroup *animation=[CAAnimationGroup animation];CABasicAnimation *animation=[CABasicAnimation animat... 阅1004 转4 评0 公众公开 15-01-30 19:45 |
CAKeyframeAnimation例子 -(CAAnimation*)animation { CAKeyframeAnimation* animation; animation =[CAKeyframeAnimation animation]; animation.path = path; CGPathRelease(path); animation.duration = 5; animation.repeatCount = 10000; animation.calculationMode = @"cubic"; animation.calcula... 阅78 转0 评0 公众公开 15-01-30 19:41 |
更改UIView的背景 周末在家没事情,看看别人的博客,学到不少东西下面来说一下各种更改UIView背景的方法,当然这里的背景色不是纯色,这里主要说的是图片1:加一个UIImageView在UIView上面。UIImage *image=[UIImage imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"kanmei" ofType:@"jpg"]];view.back... 阅68 转1 评0 公众公开 15-01-30 19:37 |
变换操作函数概览如何修改CTM如何创建一个仿射变换如何选择两个相同的变换如何获取user-to-device-space变换Quartz变换函数我们可能使用Quartz内置的变换函数方便的平移、旋转和缩放我们的绘图。我们同样能用仿射矩阵来联结CTM。复制代码CGContextRotateCTM (myContext,radians ( 22.));CGContextScaleCTM (myContext,.25, .5);CGContextTransl... 阅598 转2 评0 公众公开 15-01-30 19:26 |
IOS动画总结一.基本方式:使用UIView类的UIViewAnimation扩展。+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion.+ (void)transitionWithView:(UIView *)view duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animati... 阅314 转3 评0 公众公开 15-01-30 19:24 |