1 |
package soo.ui.simple; |
---|
2 |
|
---|
3 |
import java.net.URI; |
---|
4 |
|
---|
5 |
import android.app.Activity; |
---|
6 |
import android.graphics.Color; |
---|
7 |
import android.os.Bundle; |
---|
8 |
import android.view.View; |
---|
9 |
import android.view.View.OnClickListener; |
---|
10 |
import android.widget.ImageView; |
---|
11 |
|
---|
12 |
public class ImageViewTest extends Activity implements OnClickListener{ |
---|
13 |
/** Called when the activity is first created. */ |
---|
14 |
ImageView iv=null; |
---|
15 |
@Override |
---|
16 |
public void onCreate(Bundle savedInstanceState) { |
---|
17 |
super.onCreate(savedInstanceState); |
---|
18 |
setContentView(R.layout.main); |
---|
19 |
|
---|
20 |
iv = (ImageView)findViewById(R.id.imageView01); |
---|
21 |
|
---|
22 |
/* |
---|
23 |
|
---|
24 |
// 1. 臾대� �대� �대���泥�━ |
---|
25 |
iv.setOnClickListener(new OnClickListener() { |
---|
26 |
|
---|
27 |
@Override |
---|
28 |
public void onClick(View v) { |
---|
29 |
// TODO Auto-generated method stub |
---|
30 |
//iv.setImageURI(new URI("http://developer.android.com/assets/images/bg_logo.png")); |
---|
31 |
//iv.setImageURI(new URI()); |
---|
32 |
//iv.setMaxHeight("50PX"); |
---|
33 |
iv.setBackgroundColor(Color.CYAN); |
---|
34 |
iv.setMaxHeight(50); |
---|
35 |
} |
---|
36 |
}); |
---|
37 |
*/ |
---|
38 |
|
---|
39 |
// 2. ��� �대� �대��ㅻ� 蹂�꼍 |
---|
40 |
//iv.setOnClickListener(new A()); |
---|
41 |
|
---|
42 |
// 3. ������대��ㅼ����대깽��泥�━ |
---|
43 |
iv.setOnClickListener(this); |
---|
44 |
} |
---|
45 |
/* |
---|
46 |
class A implements OnClickListener{ |
---|
47 |
public void onClick(View v) { |
---|
48 |
// TODO Auto-generated method stub |
---|
49 |
//iv.setImageURI(new URI("http://developer.android.com/assets/images/bg_logo.png")); |
---|
50 |
//iv.setImageURI(new URI()); |
---|
51 |
//iv.setMaxHeight("50PX"); |
---|
52 |
iv.setBackgroundColor(Color.BLUE); |
---|
53 |
iv.setMaxHeight(50); |
---|
54 |
} |
---|
55 |
} |
---|
56 |
*/ |
---|
57 |
|
---|
58 |
public void onClick(View v) { |
---|
59 |
// TODO Auto-generated method stub |
---|
60 |
//iv.setImageURI(new URI("http://developer.android.com/assets/images/bg_logo.png")); |
---|
61 |
//iv.setImageURI(new URI()); |
---|
62 |
//iv.setMaxHeight("50PX"); |
---|
63 |
iv.setBackgroundColor(Color.RED); |
---|
64 |
iv.setMaxHeight(50); |
---|
65 |
} |
---|
66 |
} |
---|