코틀린study

[코틀린] 체크박스/스위치/이미지/버튼

working for you 2021. 8. 7. 17:52
반응형
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="30dp"
    tools:context=".MainActivity">
 
        <CheckBox
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                android:id="@+id/android"
                android:text="안드로이드폰"
                android:checked="true"/>
        <CheckBox
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                android:id="@+id/iphone"
                android:text="아이폰"
                />
        <CheckBox
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                android:id="@+id/window"
                android:text="윈도폰"
                android:checked="true"
                />
        <Switch
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                android:checked="true"
                />
        <Switch
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                android:checked="false"
                />
        <ToggleButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                android:checked="true"
                />
        <ToggleButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                android:checked="false"
                />
        <RadioGroup
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                android:id="@+id/rGroup1">
                <RadioButton
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                        android:text="남성"
                        />
                <RadioButton
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                        android:text="여성"
                        />
        </RadioGroup>
        <ImageView
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:src="@drawable/q10"/>
        <ImageView
            android:layout_width="180dp"
            android:layout_height="50dp"
            android:scaleType="fitCenter"
            android:src="@drawable/q10"/>
        <ImageView
            android:layout_width="180dp"
            android:layout_height="50dp"
            android:scaleType="fitXY"
            android:src="@drawable/q10"/>
 
        <ImageButton
            android:layout_width="150dp"
            android:layout_height="100dp"
            android:scaleType="fitCenter"
            android:src="@drawable/q10"/>
 
 
 
</LinearLayout>
cs

 

출처 : 코틀린을 활용한 안드로이드 프로그래밍

반응형