Android Api Demos登顶之路(十九)Rotation Animation

这个Demo演示了手机屏幕旋转时的动画效果,基本思路就是通过设置Window的属性,实现屏幕旋转时的动画效果, 但要求必须是Api18以上。
在这个小Demo上还出了一点小状况,程序运行时一直看不到效果,开始怀疑是不是自己对rotationAnimation 理解错了?查了一天的资料也没找到问题所在(不过还是有所收获的,呵呵),一天都比较郁闷。
后来才注意到, 当我旋转模拟器的屏幕时,屏幕的状态居然没有调整,于是在oncreate()方法里加了一了syso语句来监听 果然当屏幕旋转时居然没有重新调用oncreate()方法。
我用的是Api19的模拟器。不知道是模拟器有bug还是什么 原因,有知道的大神请帮忙解答下。不知道大家是否也遇到过这种情况。
后来换了一个Api18的模拟器,问题解决,运行正常。
布局文件activity .xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="5dp" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/info"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <CheckBox
        android:id="@+id/cb_fullScren"
        android:layout_marginTop=
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值