1. CGAffineTransform moveRight = CGAffineTransformTranslate(CGAffineTransformIdentity, 20, 0);
  2. CGAffineTransform moveLeft = CGAffineTransformTranslate(CGAffineTransformIdentity, -20, 0);
  3. CGAffineTransform resetTransform = CGAffineTransformTranslate(CGAffineTransformIdentity, 0, 0);
  4. [UIView animateWithDuration:0.1 animations:^{
  5. self.transform = moveLeft;
  6. } completion:^(BOOL finished) {
  7. [UIView animateWithDuration:0.1 animations:^{
  8. self.transform = moveRight;
  9. } completion:^(BOOL finished) {
  10. [UIView animateWithDuration:0.1 animations:^{
  11. self.transform = moveLeft;
  12. } completion:^(BOOL finished) {
  13. [UIView animateWithDuration:0.1 animations:^{
  14. self.transform = resetTransform;
  15. }];
  16. }];
  17. }];
  18. }];
 
    • rect1.origin.x -= 10;
      [UIView animateWithDuration:0 delay:0 options:UIViewAnimationTransitionNone animations:^(void){

      logInWindow.frame = rect1;
      } completion:^(BOOL finshed){

      [UIView animateWithDuration:0.01 delay:0 options:UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat animations:^(void){
      [UIView setAnimationRepeatCount:20];
      logInWindow.frame = firstRect;

      } completion:^(BOOL finshed){

      }]; }];

UIImageView加抖动效果(转)的更多相关文章

  1. CSS Shake – 摇摆摇摆!动感的 CSS 抖动效果

    CSS Shake 是一套 CSS3 动画特效,让页面的 DOM 元素实现各种效果的抖动(Shake),这些效果可以轻松的被应用到按钮.LOGO 以及图片等元素.所有这些效果都是只需要单一的标签,加上 ...

  2. 通用的Android控件抖动效果实现

    这个小程序的功能在实际的开发中会用到,比如:设置Button左右晃动,或者上下的晃动效果,下面就给出示例代码. 首先:要定义一个xml文件,命名为Shake [html] view plain cop ...

  3. Android 自定义圆形旋转进度条,仿微博头像加载效果

    微博 App 的用户头像有一个圆形旋转进度条的加载效果,看上去效果非常不错,如图所示: 据说 Instagram 也采用了这种效果.最近抽空研究了一下,最后实现的效果是这样: 基本上能模拟出个大概,代 ...

  4. iOS图片加水印效果的实现并保存至相冊

    图片加水印效果的实现并保存至相冊 实现效果如图: project下载:githubproject下载链接 代码: - (void)viewDidLoad { [super viewDidLoad]; ...

  5. layer实现窗口抖动效果

    function showMsg(msg, icon){ layer.msg(msg, { //1:正确:2:错误:3:询问:4:锁定:5:失败:6:成功:7:警告:16:加载 icon : icon ...

  6. AJ学IOS(40)UI之核心动画_抖动效果_CAKeyframeAnimation

    AJ分享,必须精品 效果: 效果一: 效果二: 代码: // // NYViewController.m // 图片抖动 // // Created by apple on 15-5-8. // Co ...

  7. CSS鼠标悬停图片加边框效果,不位移的方法

    <!DOCTYPE HTML> <html lang="en-US"> <head> <title>css实现鼠标悬停时图片加边框效 ...

  8. 使用 SVG 实现一个漂亮的页面预加载效果

    今天我们要为您展示如何使用 CSS 动画, SVG 和 JavaScript 创建一个简单的页面预加载效果.对于网站来说,这些预载入得画面提供了一种创造性的方法,使用户在等待内容加载的时候不会那么无聊 ...

  9. [js开源组件开发]loading加载效果

    loading加载效果 由于程序和网络的原因,常常我们需要在交互的时候,给用户一个正在加载中的动画,于是,loading组件横空出世.不需要复杂的代码,也能完成大多数业务,这就是我做组件的原则. 效果 ...

随机推荐

  1. ionic获取事件中的对象

    ng-click="submit1($event, 'argsTest’)" $scope.submit1=function(event, args){ var target = ...

  2. POJ 1159 - Palindrome (LCS, 滚动数组)

    Palindrome Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 55018   Accepted: 19024 Desc ...

  3. Leetcode 338. Counting Bits

    Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the ...

  4. ECharts地图详解 【转】

    $(function() { // 路径配置 require.config({ paths : { // echarts: 'http://echarts.baidu.com/build/dist' ...

  5. Core Bluetooth Programming Guide

    https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth ...

  6. Java加密解密相关

    关于解释加密解密中的填充方案: http://laokaddk.blog.51cto.com/368606/461279/ 关于对称加密中的反馈模式: http://blog.csdn.net/aaa ...

  7. SharpZipLib 压缩后传输给第三方平台无法识别问题

    问题描述:在项目中需要将文件压缩然后传输给三方进行彩信发送,使用SharpZipLib 进行压缩,原先使用J#进行压缩处理,但是用SharpZipLib压缩后的zip文件传输过去之后,总会报发送失败. ...

  8. UIView中常见的方法总结

    addSubview: 添加一个子视图到接收者并让它在最上面显示出来.- (void)addSubview:(UIView *)view[讨论]这方法同样设置了接收者为下一个视图响应对象.接收者保留视 ...

  9. jqGrid API 全

    JQGrid是一个在jquery基础上做的一个表格控件,以ajax的方式和服务器端通信. JQGrid Demo 是一个在线的演示项目.在这里,可以知道jqgrid可以做什么事情. 下面是转自其他人b ...

  10. java匿名内部类练习

    interface Inter { void method(); } class Test { //补足代码.通过匿名内部类. /* static class Inner implements Int ...