国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

設置動畫結束的監聽事件

2019-11-09 17:38:30
字體:
來源:轉載
供稿:網友

在項目中,今天就遇到了動畫還沒結束就跳到下個界面,這很顯然是糊弄不了客戶——.——無奈

于是就找解決方案,很顯然最好的方案就是監聽動畫結束

解決辦法:主要利用SetAnimationLisener給imageview的準備setAnimation的那個動畫,設置一個SetAnimationLisener,然后導入,在onEnd里面去處理跳轉等后續操作即可。

代碼如下

public class TiaoAnim extends AppCompatActivity {    ImageView image_view;    @Override    PRotected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_tiao_anim);        image_view= (ImageView) findViewById(R.id.image_view);        startHotelNearByIconAnim();    }    protected void startHotelNearByIconAnim() {        Animation anim = new TranslateAnimation(Animation.RELATIVE_TO_SELF,                Animation.RELATIVE_TO_SELF+300F, Animation.RELATIVE_TO_SELF,                Animation.RELATIVE_TO_SELF + 300F);        anim.setDuration(3000);              anim.setRepeatCount(0);        image_view.startAnimation(anim);        anim.setAnimationListener(new Animation.AnimationListener() {            @Override            public void onAnimationStart(Animation animation) {            }            @Override            public void onAnimationRepeat(Animation animation) {            }            @Override            public void onAnimationEnd(Animation animation) {
		這里就是動畫結束,在這里寫跳轉0.0                Intent intent=new Intent(TiaoAnim.this,Main4Activity.class);                startActivity(intent);            }        });    }}ok  就這樣吧0.0


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 天柱县| 和静县| 汝州市| 扎囊县| 来宾市| 哈尔滨市| 大城县| 那坡县| 揭阳市| 冷水江市| 聂拉木县| 潼南县| 陇南市| 景泰县| 平安县| 团风县| 永清县| 尼木县| 安远县| 金门县| 马尔康县| 富锦市| 阳曲县| 海伦市| 夹江县| 丰都县| 长葛市| 神木县| 新源县| 沽源县| 江源县| 吉木萨尔县| 长寿区| 慈利县| 疏勒县| 雅安市| 邓州市| 平江县| 白城市| 阿克苏市| 大兴区|