【发布时间】:2014-10-30 01:46:41
【问题描述】:
我正在熟悉 IonicFramework 并构建非常简单的应用程序。 现在它有一个按钮显示面板(淡入,也在尝试从底部滑入)。它在 Android 上运行良好,但在 iOS 动画上开始时有奇怪的闪烁(在模拟器和设备上)。
基本上我的看法如下:
<ion-content class="has-header" ng-controller="MainCtrl">
<div class="container">
<button class="btn btn__big centered primary" ng-click="toggleDetails()">toggle info</button>
</div>
<div class="panel panel-animated primary ng-hide" ng-show="detailsVisible">
Details here
</div>
</ion-content>
还有我应用于 ng-show 的带有动画的 css 类
.panel {
position: absolute;
width: 100%;
height: 40%;
top: 60%;
padding: 1em;
}
.panel-animated {
-webkit-animation: fadeIn 0.5s;
-moz-animation: fadeIn 0.5s;
animation: fadeIn 0.5s;
}
.panel-animated.ng-hide {
-webkit-animation: fadeOut 0.5s;
-moz-animation: fadeOut 0.5s;
animation: fadeOut 0.5s;
}
我没有使用任何外部库来制作动画,只是简单的 Ionic 内置动画类。 我创建了repository with complete, ready to run application,所以你可能想检查一下。
还有显示闪烁的视频,但由于 Flash 视频很垃圾,因此只记录了一个,而实际上还有更多 video here
【问题讨论】:
标签: ios angularjs css-animations ionic-framework