안녕하세요.
버튼이 3개 있는데, 첫번째 버튼을 눌렀다 떼었을 경우에 관련해서 버튼의 배경화면이 바뀌었다가 다시 원래대로 돌아
오도록 이벤트를 주었습니다. 그런데, 총 3개의 버튼중 어떤것 하나가 클릭이 된다면, 나머지 버튼이 클릭이 되도록 만
않고싶은데 그 방법을 모르겠습니다.
예를들어, 지금 첫번째 버튼을 누를 경우에 배경화면이 Gray로 바뀝니다. 여기서 두번째 버튼을 누른다면
첫번째 버튼이 다시 원래의 배경색이 되면서 두번째 버튼의 배경이 Gray가 되도록 만들고 싶습니다.
또한 두번쨰 버튼이 눌린상태(Button의 배경색이 Gray)에서 세번째 버튼을 누르게 된다면 버튼의 배경화면을
Gray로 만들고 싶습니다. 한마디로 클릭된 것에 따라서, 배경색을 주고 싶은데.. 어떻게 코드를 구성해주어야
할지 잘 모르겠습니다 ㅜ ㅜ .. 또한 화면의 맨 아래의 Pay Button을 눌렀을 경우에 버튼이벤트에 위의 Button이 클릭
된것이 오직 하나일때만 토스트 메세지를 "성공" 이라고 뜨게 해야하는데.. 막막합니다 ㅠ ㅠ
소스가 조금 넘치는 부분은 아래의 댓글 부분에 달아보겠습니다.
< XML 부분 >
< XML 부분 >
<LinearLayout
android:id="@+id/Payment_DiscountButton_Layout"
android:layout_below="@+id/Payment_Discount_Layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/Discount_Button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="멤버십 포인트"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp" />
<Button
android:id="@+id/Discount_Button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="마일리지 번호"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
/>
<Button
android:id="@+id/Discount_Button3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20dp"
android:text="없음"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
/>
</LinearLayout>