결과값 :
activity_main.xml
<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:paddingLeft="30dp" android:paddingRight="30dp" android:paddingTop="20dp" > <TextView android:id="@+id/View" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="30dp" android:text="계산 결과 :" android:textSize="30dp" android:textStyle="bold" /> <EditText android:id="@+id/Edit1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:hint="첫 번째 숫자" /> <EditText android:id="@+id/Edit2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:hint="두 번째 숫자" /> <Button android:id="@+id/BtnAdd" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:background="#D592B7" android:text="더하기" /> <Button android:id="@+id/BtnHy" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:background="#CF10D2" android:text="빼기" /> <Button android:id="@+id/BtnGob" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:background="#5BA917" android:text="곱하기" /> <Button android:id="@+id/BtnMod" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:background="#8A7E98" android:text="나누기" /> </LinearLayout> |
MainActivity.java
package com.example.android_calc; |