2015-11-24 41 views
0

您好我有线性布局两个视图垂直方向,如下,我要动起来,当显示和隐藏第二视图下移动画。 就好像现在当我显示并隐藏第二个imageview它像突然改变一样工作,我想使它使用一些动画平滑过渡。查看向上和向下移动翻译动画时的显示和隐藏

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:layout_gravity="bottom" 
android:gravity="center_horizontal|bottom" 
android:orientation="vertical" 
android:paddingBottom="@dimen/small_padding" 
android:paddingTop="@dimen/normal_padding" 
android:weightSum="2"> 

<ImageView 
    android:id="@+id/b_icon" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_gravity="center" 
    android:layout_marginBottom="-4dp" 
    android:layout_marginTop="3dp" 
    android:contentDescription="@null" 
    android:paddingBottom="@dimen/normal_padding" 
    android:src="@drawable/find_books" /> 

<ImageView 
    android:id="@+id/tab_icon_shadow" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/tab_icon_shadow" 
    android:visibility="gone" /> 
</LinearLayout> 

回答

0

您应该结合翻译& AlphaAnimation使过渡平滑。

+0

你好我已经加入Android的平稳过渡:animateLayoutChanges =“真”,现在它变得不添加任何动画流畅。 – Nandhu

0

您好我已经添加机器人:animateLayoutChanges =“真”,现在它变得不添加任何动画

相关问题