国产探花免费观看_亚洲丰满少妇自慰呻吟_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


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 惠安县| 临潭县| 凉城县| 密山市| 文化| 和林格尔县| 遵义市| 织金县| 阿荣旗| 高青县| 巴东县| 蓬莱市| 聂拉木县| 博乐市| 成安县| 罗江县| 垦利县| 鲜城| 原平市| 若羌县| 杭州市| 临沂市| 安塞县| 宁夏| 望江县| 大渡口区| 台中市| 宝山区| 慈溪市| 岢岚县| 海南省| 江门市| 万安县| 陵川县| 静海县| 东乡县| 安义县| 贡觉县| 汪清县| 台江县| 文山县|