ios開發隨筆第二天 簡單動畫的實現,ios開發隨筆第二天

來源:互聯網
上載者:User

ios開發隨筆第二天 簡單動畫的實現,ios開發隨筆第二天

    首先對視圖要有一定的瞭解,這裡我就不多介紹了,

    先說一種已經基本不用的頭尾式動畫 

    首先 設定一個view  UIView * testView = [UIView alloc]init];

    確定位置  self.testView.frame = CGRectMake(0,0,50,50);

    開始動畫

   [ UIView beginAnimations:nil context: nil   ]

    設定動畫期間

    [UIView  setAnimationDuration:2.0]

    可動畫屬性數值

    self.testView.frame = rect ;

    self.testView.backgroundColor = [UIColor blueColor];

    提交動畫

  [UIView commitAnimations];

 

    塊動畫 比較流行的動畫方法 ,有很多細節可以去探討,很多方法,屬性可以去探索

    [UIView animateWithDuration :期間 delay:延遲時間 usingSpringWithDamping: 彈性 initialSpringVelocity:動畫啟動並執行速 options:動畫啟動並執行方式選項  animations:^{

         動畫運行時執行的代碼 

     } completion:^(BOOL finished) {

        動畫完成後執行的代碼

     }];

 

今天由於時間關係,就分享這麼一個簡單的動畫在這裡

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.