欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

iOS自帶動(dòng)畫效果的實(shí)例代碼

 更新時(shí)間:2016年12月27日 10:21:56   作者:紹棠  
本文給大家分享ios自帶動(dòng)畫效果的實(shí)現(xiàn)代碼,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友參考下吧

 1.普通動(dòng)畫:

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2];
frame.origin.x += 150;
[img setFrame:frame];
[UIView commitAnimations];

2.連續(xù)動(dòng)畫(一系列圖像):

NSArray *myImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"myImage1.png"],
[UIImage imageNamed:@"myImage2.png"],
[UIImage imageNamed:@"myImage3.png"],
[UIImage imageNamed:@"myImage4.png"], nil];
UIImageView *myAnimatedView = [[UIImageView alloc] initWithFrame:[self bounds]];
myAnimatedView.animationImages = myImage;
myAnimatedView.animationRepeatCount = 0;
[myAnimatedView startAnimating];
[self addSubview:myAnimatedView];
[my AnimatedView release];

3.CATransition Public API:

CATransition *animation = [CATransition animation];
animation.duration = 0.5f;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.fillMode = KCAFillModeForwards;
//各種動(dòng)畫效果
/*
KCATransitionFade;
KCATransitionMoveIn;
KCATransitionPush;
KCATransitionReveal;
*/
/*
KCATransitionFromeRight;
KCATransitionFromLeft;
KCATransitionFormTop;
kCATransitionFromButtons;
*/
//各種組合
animation.type = KCATransitionPush;
animation.subtype = KCATransitionFromRight;
[self.view.layer addAnimation:animation forKey:@"animation"];

4.UIView Animations動(dòng)畫:

[UIView beginAnimations:@"animationID" context:nil];
[UIView setAnimationDuration:0.5f];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationRepeatAutoreverses:NO];
//以下四種效果
/*
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFormLeft forView:self.view cache:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFormRight forView:self.view cache:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES];
*/

5.嵌套使用,先變大再消失

[UIView animateWithDuration:1.25 aniamtions:^{
    CGAffineTransform newTRansform = CGAffineTransformMakeScale(1.2, 1.2);
    [firstImageView setTransform:newTransform];
    [secondImageView setTransform:newTransform];
    completion:^(BOOL finished){
        [UIView animateWithDuration:1.2 animations:^{
            [firstImageView setAlpha:0];
            [secondImageView setAlpha:0];
        }
        completion:^(BOOL finished){
            [firstImageView removeFromSuperview];
            [secondImageView removeFromSuperview];
        }
        ];
    }
];

以上所述是小編給大家介紹的iOS自帶動(dòng)畫效果的實(shí)例代碼,希望對(duì)大家有所幫助,如果大家有任何疑問請給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

  • UITableView 實(shí)現(xiàn)汽車品牌(demo)

    UITableView 實(shí)現(xiàn)汽車品牌(demo)

    UITableView堪稱UIKit里面最復(fù)雜的一個(gè)控件了,使用起來不算難,但是要用好并不容易,當(dāng)使用的時(shí)候我們必須要考慮到后臺(tái)數(shù)據(jù)的設(shè)計(jì),tableViewCell的設(shè)計(jì)和重用以及tableView的效率等問題,下面小編通過UITableView 實(shí)現(xiàn)汽車品牌,需要的朋友可以參考下
    2015-08-08
  • iOS內(nèi)存管理中引用計(jì)數(shù)的學(xué)習(xí)

    iOS內(nèi)存管理中引用計(jì)數(shù)的學(xué)習(xí)

    文章給大家分享了關(guān)于iOS內(nèi)存管理中引用計(jì)數(shù)的相關(guān)知識(shí)點(diǎn),對(duì)此有需要的朋友可以跟著學(xué)習(xí)下。
    2018-05-05
  • 10個(gè)非常實(shí)用的iOS小技巧

    10個(gè)非常實(shí)用的iOS小技巧

    這篇文章主要為大家詳細(xì)介紹了10個(gè)非常實(shí)用的iOS小技巧,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-03-03
  • iOS自定義UIBarButtonItem的target和action示例代碼

    iOS自定義UIBarButtonItem的target和action示例代碼

    這篇文章主要給大家介紹了關(guān)于iOS自定義UIBarButtonItem的target和action的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-02-02
  • iOS開發(fā)之tableView實(shí)現(xiàn)左滑刪除功能

    iOS開發(fā)之tableView實(shí)現(xiàn)左滑刪除功能

    我們在使用一些應(yīng)用的時(shí)候,在滑動(dòng)一些聯(lián)系人的某一行的時(shí)候,會(huì)出現(xiàn)刪除、置頂、更多等等的按鈕,下面這篇文章主要就介紹了iOS用tableView實(shí)現(xiàn)左劃刪除功能的方法,有需要的朋友們可以參考借鑒,下面來一起看看吧。
    2017-01-01
  • iOS 控件封裝(又名擰螺絲)之排序按鈕的開發(fā)

    iOS 控件封裝(又名擰螺絲)之排序按鈕的開發(fā)

    排序按鈕是實(shí)際開發(fā)中比較常見的一種控件,這篇文章主要介紹了iOS 開發(fā)之排序按鈕,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2018-12-12
  • IOS實(shí)現(xiàn)百度地圖自定義大頭針和氣泡樣式

    IOS實(shí)現(xiàn)百度地圖自定義大頭針和氣泡樣式

    這篇文章主要介紹了 IOS百度地圖自定義大頭針和氣泡的實(shí)例代碼,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友參考下
    2016-12-12
  • iOS開發(fā)之時(shí)間戳(或date)轉(zhuǎn)字符串的實(shí)例代碼

    iOS開發(fā)之時(shí)間戳(或date)轉(zhuǎn)字符串的實(shí)例代碼

    這篇文章主要介紹了iOS開發(fā)之時(shí)間戳(或date)轉(zhuǎn)字符串的實(shí)例代碼,需要的朋友可以參考下
    2017-10-10
  • IOS多線程編程的3種實(shí)現(xiàn)方法

    IOS多線程編程的3種實(shí)現(xiàn)方法

    這篇文章主要介紹了IOS多線程編程的3種實(shí)現(xiàn)方法的相關(guān)資料,需要的朋友可以參考下
    2015-11-11
  • iOS App開發(fā)中UIViewController類的使用教程

    iOS App開發(fā)中UIViewController類的使用教程

    UIViewController是iOS中控制視圖的關(guān)鍵所在,這里我們將針對(duì)UIViewController的聲明周期與主要屬性和方法,來總結(jié)iOS App開發(fā)中UIViewController類的使用教程
    2016-07-07

最新評(píng)論