IPHONE note

来源:互联网 发布:淘宝众筹定金和尾款 编辑:程序博客网 时间:2024/06/02 13:18

TableViewController:

  1 disable selected:willSelectedRowAtIndex:(NSIndexPath *)index{ return nil; }
   2 TableView can custom it'stitle foot
   3 Adding float title effect:titleForHeaderInSection:(NSInteger)section{return "ss"};

Favoriate background color
   [UIColorcolorWithRed:197.0/255.0 green:204.0/255.0 blue:211.0/255.0alpha:1.0];

Generate random number
  1. // Get random number between 0 and 500
  2. int x = arc4random() %100;
  3. // Get random number between 500 and 1000
  4. int y = (arc4random()% 501) +500);
  5. //Get random number among a specify number
  6. (rand()%6)+1
View animation transation:
UIViewAnimationTransitionNone,UIViewAnimationTransitionFlipFromLeft,UIViewAnimationTransitionFlipFromRightUIViewAnimationTransitionCurlU,UIViewAnimationTransitionCurlDown

Animation Transaction: animation同样支持事务,让一群Animation一起提交

Action:
  一个Layer管理很多Action,每个Action有一个keylayer.actions=actions(NSMutableDirectory)
   Layer执行Action:actionForLayer:forKey.方法
   Layer在几种情况下会触发Action, 1被插入一个Layer-Tree, 2被remove一个Layer-Tree 3被replace一个Layer
  每个CAAction实现runActionForKey方法,在其中定义Animation,可以实现actionForKey返回一个CAAnimation来指定默认的implite animation


Add Image for view background
    UIView doesn't support add image to background. The solution is add an ImageView to surface of UIView. And allow user can interaction with its subviews
    [imageView setUserInteractionEnabled:YES]