導航:首頁 > 操作系統 > android開發小圖標

android開發小圖標

發布時間:2025-06-23 16:40:01

android 能在屏幕上繪一張小圖片,然後透明背景,還能操作能看到的背景桌面圖標或程序。

package com.qdsx.cml;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
//import android.view.animation.AnimationUtils;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
public class TestdonghuaActivity extends Activity {
private ImageView tweenMM;
// private Animation animation;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tweenMM =(ImageView)findViewById(R.id.imageView1);
}

//漸變
public void BtnAlphaOnClick(View view){
//this.doStartAnimation(R.anim.alpha_animation);
Animation b = new AlphaAnimation(0.1f, 1.0f);
b.setDuration(2000);
tweenMM.startAnimation(b);
}
//旋轉
public void BtnrotateOnClick(View view){
//this.doStartAnimation(R.anim.rotate_animation);
Animation c = new RotateAnimation(0, 360,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
c.setDuration(3000);
tweenMM.startAnimation(c);
}
//縮放
public void BtnScaleOnClick(View view){
//this.doStartAnimation(R.anim.scale_animation);
Animation d = new ScaleAnimation(0f, 1f, 0f, 1f, Animation.RELATIVE_TO_SELF,0.5f, Animation.RELATIVE_TO_SELF,0.5f);
d.setDuration(3000);
tweenMM.startAnimation(d);
}
//位移
public void BtnTransalteOnclick(View view){
//this.doStartAnimation(R.anim.translate_animation);
Animation a= new TranslateAnimation(0, 100, 0, 100);
a.setDuration(5000);
a.setFillAfter(true);//使圖片移動後固定
tweenMM.startAnimation(a);
}

//開始動畫方法
/* private void doStartAnimation(int animid){
animation = AnimationUtils.loadAnimation(this, animid);
animation.setFillAfter(true);//使圖片移動後固定
tweenMM.startAnimation(animation);
}*/
}

閱讀全文

與android開發小圖標相關的資料

熱點內容
子宮肌瘤手術前吃什麼解壓葯好 瀏覽:296
虛擬機兩台伺服器怎麼互聯 瀏覽:876
什麼是王者伺服器達到上限 瀏覽:574
linux伺服器地址看哪個 瀏覽:784
如何發送游戲鏈接伺服器 瀏覽:884
se殼網路驗證源碼下載 瀏覽:139
程序員的偶像都有誰 瀏覽:237
四川哪裡有考編程的學校 瀏覽:44
30源碼網會員 瀏覽:351
亮劍java項目開發案例導航源碼 瀏覽:830
四等測量前視距的演算法 瀏覽:909
java集合遍歷刪除 瀏覽:695
單片機的輸出驅動 瀏覽:922
zft屬於以太坊加密貨幣嗎 瀏覽:732
linuxexecve 瀏覽:978
java線程題目 瀏覽:169
倒角標注命令 瀏覽:745
防攻擊伺服器和國內有什麼區別 瀏覽:757
我的世界中國本地伺服器地址 瀏覽:993
周深參加密室大逃脫 瀏覽:612