昨天我向市场上传了一个应用程序,我不得不将uses-sdk android:minSdkVersion="4"
项目添加到清单文件中。添加此项目后,我的 ViewFlipper 小部件出现了奇怪的行为。没有 minSdkVersion 视图 Flipper 使用动画没有问题,添加后它会忽略它们,或者至少似乎没有使用动画。我还使用 minSdkVersion="8" 进行了测试,但遗憾的是它没有帮助让动画正常工作。还尝试同时添加:(uses-sdk android:minSdkVersion="4" android:targetSdkVersion="8"
),相同的行为。从清单中删除 minSdkVersion 项目(本地测试)使 ViewFlipper 像魅力一样工作。Market 不允许我在 Manifest 中上传没有 minSdkVersion 项的 APK。
有人知道这是怎么回事吗?在我看来,这确实是一种奇怪的行为,它确实降低了应用程序的质量/用户体验。如果有人知道如何解决此问题,请提供帮助。
我如何使用鳍状肢翻阅内容的代码片段。
// call for the flipper to show the next item
flipper.setInAnimation(AnimationHelper.inFromLeftAnimation());
flipper.setOutAnimation(AnimationHelper.outToRightAnimation());
flipper.showNext();
// animation example method
public static Animation inFromRightAnimation() {
Animation inFromRight = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, +1.0f,
Animation.RELATIVE_TO_PARENT, 0.0f,
Animation.RELATIVE_TO_PARENT, 0.0f,
Animation.RELATIVE_TO_PARENT, 0.0f);
inFromRight.setDuration(150);
inFromRight.setInterpolator(new AccelerateInterpolator());
return inFromRight;
}
// XML: current Android manifest config for minSdkVersion
<uses-sdk android:minSdkVersion="4"
android:targetSdkVersion="8"
/>
谢谢大家,最好的问候, Mitja