小编use*_*589的帖子

将android:layoutAnimation添加到LinearLayout会导致FC

我在menu.xml中有以下XML,它是一个我需要设置动画的LinearLayout,所以我使用了layoutAnimation属性.如果没有这个属性,布局会显示出来,但是有了这个属性集我会得到一个令人讨厌的forceclose,我不明白为什么:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/bkgrnd"
    android:layoutAnimation="@anim/menu_anim" <=== adding this results in FC
...etc...
Run Code Online (Sandbox Code Playgroud)

动画/ menu_anim.xml:

<?xml version="1.0" encoding="utf-8"?>
<set
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false">
    <alpha
        android:fromAlpha="0.0"
        android:toAlpha="1.0"
        android:duration="500">
    </alpha>    

</set>
Run Code Online (Sandbox Code Playgroud)

请帮忙!谢谢!

android-animation forceclose

0
推荐指数
1
解决办法
3417
查看次数

标签 统计

android-animation ×1

forceclose ×1