android 簡單圖片動畫播放的實例代碼
xml中:
<ImageView
android:id="@+id/touchview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:src="@drawable/touch" />
java中:
mTouchView = (ImageView) findViewById(R.id.touchview);
AlphaAnimation mAlphaAnimation = new AlphaAnimation(0.1f, 1.0f); ////創(chuàng)建一個AlphaAnimation對象,參數從透明到不透明
mAlphaAnimation.setDuration(1000);// 設定動畫時間
mAlphaAnimation.setRepeatCount(Animation.INFINITE);//定義動畫重復時間
mAlphaAnimation.setRepeatMode(Animation.REVERSE);//通過設置重復時間定義動畫的行為
mTouchView.setAnimation(mAlphaAnimation);
mAlphaAnimation.start();
相關文章
Android中RecyclerView布局代替GridView實現類似支付寶的界面
RecyclerView比GridView來得更加強大,不僅是在分割線的繪制方面,在條目的編輯上也做得同樣出色,下面就來看一下Android中RecyclerView布局代替GridView實現類似支付寶的界面的實例2016-06-06
Android布局控件DrawerLayout實現完美側滑效果
這篇文章主要為大家詳細介紹了Android布局控件DrawerLayout實現完美側滑效果,具有一定的參考價值,感興趣的小伙伴們可以參考一下2018-08-08
詳解Android使用CoordinatorLayout+AppBarLayout+CollapsingToolbarL
這篇文章主要為大家詳細介紹了Android使用CoordinatorLayout+AppBarLayout+CollapsingToolbarLayou實現手指滑動效果,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2020-05-05
Android開發(fā)中Intent.Action各種常見的作用匯總
今天小編就為大家分享一篇關于Android開發(fā)中Intent.Action各種常見的作用匯總,小編覺得內容挺不錯的,現在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧2018-12-12

