public class Main extends Activity { RelativeLayout layout; ImageView imgLogo; Animation anim; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); layout = (RelativeLayout)findViewById(R.id.layout); imgLogo = (ImageView)findViewById(R.id.imgLogo); Button btnNormalScale = (Button)findViewById(R.id.btnNormalScale); btnNormalScale.setOnClickListener(new OnClickListener() { public void onClick(View arg0) { anim = new TranslateAnimation(0, 100, 0, -200); anim.setDuration(1000); imgLogo.startAnimation(anim); } }); } }
animation.setFillAfter(true);
private void MoveImage(int val) { // TODO Auto-generated method stub for(int i=1; i<=val; i++){ x2 =x2+100 anim = new TranslateAnimation(x1 ,x2, y1,y2); anim.setDuration(1); anim.setFillEnabled(true); anim.setFillAfter(true); imgLogo.startAnimation(anim); } x1=x2;
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง