偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

Xcode學習之UIView動畫例子實踐

移動開發(fā) iOS
本文介紹的是Xcode學習之UIView動畫例子實踐,詳細的介紹了UIView動畫例子實踐的內容,先來看內容詳解。

Xcode學習之UIView動畫例子實踐是本文要介紹的內容,主要是學習UIView動畫例子實踐,來學習xcode的相關內容,進一步的去學習和了解xcode,先來看內容詳解。

淡入淡出效果的例子,其中對象關系圖:

  1. SampleAppDelegate  
  2.     HelloController init  
  3.         ToggleView init  
  4.             UIImageView init  
  5.             self addSubview  
  6.             UIImageView release  
  7.         ToggleView release 

其它對象釋放

關于淡入淡出的事件觸發(fā)放在ToggleView的touchesBegan事件,實現(xiàn)的是對ToggleView本身的動畫,從而達到對子視圖UIImageView的淡出淡入的效果的控制,而UIImageView視圖作為子視圖不允許發(fā)生觸摸交換(imgView.userInteractionEnabled = NO;),僅控制自身的顯示情況

現(xiàn)在學習下UIView的新方法,下面是淡入淡出效果實現(xiàn);

  1.   // perform the fade out or fade in      
  2. CGContextRef context = UIGraphicsGetCurrentContext();      
  3. [UIView beginAnimations:nil context:context];      
  4. [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];      
  5. [UIView setAnimationDuration:1.0];      
  6. [[self viewWithTag:IMAGE_VIEW_TAG] setAlpha:(float)isVisible];//注意,這個對當前子視圖設置顯示屬性      
  7. [UIView commitAnimations]; 

UIView類

類方法:(動畫部分)

  1. beginAnimations:context:  
  2.  
  3. + (void)beginAnimations:(NSString *)animationID context:(void *)context  
  4.  
  5. Marks the beginning of a begin/commit animation block.  
  6.  
  7. setAnimationCurve:  
  8.  
  9. + (void)setAnimationCurve:(UIViewAnimationCurve)curve  
  10.  
  11. Sets the curve to use when animating property changes within an animation block.  
  12.  
  13. setAnimationDuration:  
  14.  
  15. + (void)setAnimationDuration:(NSTimeInterval)duration  
  16.  
  17. Sets the duration (measured in seconds) of the animations in an animation block.  
  18.  
  19. commitAnimations  
  20.  
  21. + (void)commitAnimations  
  22.  
  23. Marks the end of a begin/commit animation block and schedules the animations for execution. 

Constants/常量

  1. UIViewAnimationCurveEaseInOut  
  2.  
  3. An option for specifying an ease-in ease-out timing curve for the animation. An ease-in ease-out curve causes the animation to begin slowly,
  4.  accelerate through the middle of its duration, and then slow again before completing. This is the default curve for most animations.  
  5.  
  6. UIViewAnimationCurveEaseIn  
  7.  
  8. An option for specifying an ease-in timing curve for the animation. An ease-in curve causes the animation to begin slowly, 
  9. and then speed up as it progresses.  
  10.  
  11. UIViewAnimationCurveEaseOut  
  12.  
  13. An option for specifying an ease-out timing curve for the animation. An ease-out curve causes the animation to begin quickly, 
  14. and then slow down as it finishes.  
  15.  
  16. UIViewAnimationCurveLinear  
  17.  
  18. An option for specifying a linear timing curve for the animation. A linear animation curve causes an animation to occur evenly over its duration. 

小結:Xcode學習之UIView動畫例子實踐的內容介紹完了,希望本文對你有所幫助!

責任編輯:zhaolei 來源: 博客園
相關推薦

2011-08-01 10:13:46

Xcode 視圖 動畫

2012-12-24 13:38:01

iOSUIView

2011-08-16 18:13:42

IPhone開發(fā)UIView動畫

2011-07-20 14:31:56

XCode User Scrip 腳本

2011-08-01 15:57:58

2011-08-01 16:50:28

Xcode 動態(tài) View

2011-08-01 17:01:02

Xcode WindowBase View

2011-08-15 13:50:06

IPhone開發(fā)UIView動畫

2011-08-01 17:50:28

Xcode

2011-08-12 11:31:46

iPhoneUIView動畫

2011-08-10 14:00:22

XcodeUIWebView視頻

2011-08-11 16:31:08

XCode

2011-08-18 10:17:21

Xcode4Xcode

2011-07-25 15:42:38

Xcode Vim

2013-07-25 15:19:23

iOS開發(fā)學習Xcode打包framiOS開發(fā)

2011-08-08 17:05:02

XCode UserScript 腳本

2011-08-03 16:35:10

iPhone UIView 動畫

2011-08-03 16:26:14

iPhone UIView 動畫

2011-08-01 17:31:25

Xcode開發(fā) Cocoa

2011-08-19 15:16:41

XCodeUserScripts腳本
點贊
收藏

51CTO技術棧公眾號