UIButton:快速按下

时间:2015-10-19 22:41:46

标签: objective-c animation uibutton

如果我按&按住UIButton,按下按钮呈现;如果我快速按下,UIButton将转向其目标ViewController。我如何实现印刷机和对Objective-C中快速按下的按钮保持效果?

快速按下按钮:

enter image description here

按下按钮&举行:

Button Pressed & Held

2 个答案:

答案 0 :(得分:0)

只需使用

<!doctype html>
<html lang="en" ng-app="myApp" ng-controller="maincontroller">

<head>

   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
   <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
   <script src="script.js"></script>
   <script data-require="angular-bootstrap@0.12.0" data-semver="0.12.0" src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.12.0.min.js"></script>
   <link rel="stylesheet" href="style.css" />
</head>
<body>
  <div>
            <table class="table table-hover table-bordered" >
               <tbody >
                  <tr ng-repeat="row in rowData">
                     <td>
                        {{row.expNum}}
                     </td>
                     <td>
                        {{row.itemHr}}
                     </td>
                     <td>
                        {{row.highRe}}
                     </td>
                  </tr>
               </tbody>
            </table>
   </div>
  
  <input type="button" class="btn btn-danger" ng-click="update()" value="Update ItemHr to 25">
</body>
</html>

答案 1 :(得分:0)

试试这个,

  [myButton setBackgroundImage:[UIImage imageNamed:<Normal - Image>] forState:UIControlStateNormal];
  [myButton setBackgroundImage:[UIImage imageNamed:<Highlight - Image>] forState:UIControlStateHighlighted];