본문 바로가기
Android

[Android] 안드로이드 : 주요 위젯

by 꿈나무 김땡땡 2019. 11. 26.

1. TextView

 

2. Button

 

3. EditText : 입력상자

  - [예시] Plain Text > hint : 입력 전에 보이고, 입력하면 사라짐

 

4. ImageView

android:src="@drawable/house"

 

5. RadioButton (RadioGroup)

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        RadioButton radioButton = (RadioButton) findViewById(R.id.radioButton);
        boolean checked = radioButton.isChecked();


    }

댓글