¾ÛÅøÁî
46.¢½.168.138
46.¢½.168.129
46.¢½.168.161
46.¢½.168.136
46.¢½.168.145
46.¢½.168.162
46.¢½.168.144
46.¢½.168.140
115.¢½.135.198
46.¢½.168.139
 
°Ô½Ã¹° 7°Ç
 
¹öÆ° Ŭ¸¯½Ã À̹ÌÁö º¯°æÇϱ⠤¡¤¡
±Û¾´ÀÌ : ±è´ë¼± ³¯Â¥ : 2011-10-26 (¼ö) 18:46 Á¶È¸ : 14371
±âº»ÀûÀ¸·Î ÃÊ·Ï»ö À̹ÌÁö¿Í Radio ¹öÆ° 3°³°¡ º¸À̵µ·Ï ·¹À̾ƿôÀ» Àâ¾Ò½À´Ï´Ù.
±×·±ÈÄ¿¡ ¹öÆ° º¯°æ½Ã À̹ÌÁö »öÀÌ º¯°æ µÇµµ·Ï ÇغýÀ´Ï´Ù. ¤»¤»
 

// HelloAppActivity.java
package com.home;
 
import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.RadioGroup;
public class HelloAppActivity extends Activity
implements RadioGroup.OnCheckedChangeListener
{
    /** Called when the activity is first created. */
 
 RadioGroup orientation;
 ImageView img;
 Drawable defaultImg;
 Drawable blueImg;
 Drawable redImg;
 
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
       
        img = (ImageView)findViewById(R.id.imageView1);
       
        // ÀÌ ºÎºÐÀ» ¸ô¶ó¼­ ¾öû Çì¸Ë³×¿è 
        defaultImg = getResources().getDrawable(R.drawable.android_icon_125g);
        blueImg = getResources().getDrawable(R.drawable.android_icon_125b);
        redImg = getResources().getDrawable(R.drawable.android_icon_125r);
       
        orientation = (RadioGroup)findViewById(R.id.radioGroup1);
        orientation.setOnCheckedChangeListener(this);
    }
   
    public void onCheckedChanged(RadioGroup group, int checkedId)
    {
     if(group == orientation)
     {
   switch(checkedId)
   {
    case R.id.radio0: 
     img.setImageDrawable(defaultImg);
     break;
    case R.id.radio1:  
     img.setImageDrawable(blueImg);
     break;
    case R.id.radio2:
     img.setImageDrawable(redImg);
     break;
   }
     }
    }   
}
 
 
 
// main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Radio Button ¼±ÅÃÇϼ¼¿ä !!" />
    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/android_icon_125g" />
    <RadioGroup
        android:id="@+id/radioGroup1"
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
       
        <RadioButton
            android:id="@+id/radio0"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checked="true"
            android:textColor="#FF00FF00"
            android:text="Green" />
        <RadioButton
            android:id="@+id/radio1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#FF0000FF"
            android:text="Blue" />
        <RadioButton
            android:id="@+id/radio2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#FFFF0000"
            android:text="Red" />
    </RadioGroup>
</LinearLayout>

ÃÖ¿µ¼® 2011-10-28 (±Ý) 09:44
Çä~
³»°øÀÌ »§»§ÇÑ °í¼ö´ÔÀ̽ó׿ä.
     
     
±è´ë¼± 2011-10-28 (±Ý) 13:06
Çä~
À̹ÌÁö ¿Í ¶óµð¿À¹öÆ° µÎ°³¸¸ »ç¿ëÇѰǵ­... °úÂùÀ̼¼¿è ¤¾¤¾;
 
 

°Ô½Ã¹° 7°Ç
¹øÈ£ Á¦¸ñ ±Û¾´ÀÌ ³¯Â¥ Á¶È¸
7  ¹öÆ° Ŭ¸¯½Ã À̹ÌÁö º¯°æÇϱ⠤¡¤¡ +2 ±è´ë¼± 10-26 14372
6  ¹è¿î°Í º¹½Àµµ ÇÏ°í.. +1 ÃÖ¿µ¼® 10-25 2807
5  ³»ÀÏ ¸ðÀÓ Àß °¡Áö¼¼¿ä! +2 ÀÌ°æ¿ë 10-21 2787
4  ¾È³çÇϼ¼¿ä +1 Á¶¼ºÈÆ 10-01 2797
3  ÀÚÀ¯°Ô½ÃÆÇ ÀÌ¿ë ¾È³» +2 ÀÌ°æ¿ë 09-20 2973
 
 
 
Copyright ¨Ï wwwold.androidstudy.co.kr. All rights reserved.