簡體   English   中英

開始活動前進行動畫前

[英]Pre Animation before starting an Activity

我想在啟動我的android應用之前進行一些預動畫。 讓我告訴你我現在如何做。

我正在執行另一個具有ImageView的活動,我以背景透明模式打開了該活動,並延遲了2秒,然后打開了我的主屏幕。 現在,在這個概念中,問題是當我在主屏幕上按“后退”按鈕時,我跳到該動畫,因此必須再次按回去。

現在,我想添加動畫,就像我們在facebook應用程序中看到的那樣。 我希望首先出現一個imageview,然后向上移動,然后出現2​​個具有溶解效果的textview。 有人可以告訴我我怎么做嗎?

為這樣的活動制作框架布局

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
     >
<ImageView
android:id="@+id/image"
    android:src="@drawable/andro"
    android:layout_height="fill_parent"
    android:layout_width="fill_parent"
    />
<LinearLayout>
//Other Component Activity
</LinearLayout>
</FrameLayout>

然后在Activity onCreate方法中使用setVisibility(View.INVISIBLE)方法使其他組件不可見,並在2秒鍾后使用setVisibility(View.VISIBLE)方法使您的代碼組件可見,並使ImageView的可見性不可見。 這樣,當您在沒有動畫的情況下按返回按鈕時,您將看到並獲得所需的內容。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM