반응형
꾸역꾸역 한개씩
팀장님께서 리니어레이아웃
style : ?attr/buttonStryle

드디어 클릭하는 순간 색이 바뀌었습니다.

탄력받아서 그림도 바뀌게 되었고

탄력받아서 글자도 바꿀수 있게 되었습니다.
코드 구현이 아니라 설정 하는 부분이여서 꾸역꾸역 해결 해 보았습니다.
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/btn_close"
android:layout_width="300dp"
android:layout_height="60dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="32dp"
android:background="@drawable/selector_button"
android:clickable="true"// 추가 안해서 기능이 문제가 생김
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.495"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/home_btn_end"
app:layout_constraintVertical_bias="0.489">
<android.widget.ImageView
android:id="@+id/imageView2"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/btn_drawable_selector"
android:checked="true"// 추가 안해서 기능이 문제가 생김
android:clickable="true"//추가 안해서 기능이 문제가 생김
android:focusable="true"// 추가 안해서 기능이 문제가 생김
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/textView2"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="종료"
android:textSize="30dp"
android:checked="true"// 추가 안해서 기능이 문제가 생김
android:clickable="true"// 추가 안해서 기능이 문제가 생김
android:focusable="true"// 추가 안해서 기능이 문제가 생김
android:textColor="@drawable/btn_txt_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/imageView2"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.476" />
</androidx.constraintlayout.widget.ConstraintLayout>
반응형
'개발일기' 카테고리의 다른 글
23.08.11 부트캠프 33일차 TIL 개인과제 코드리뷰, 정예반 챌린지 학습 (0) | 2023.08.11 |
---|---|
23.08.10 부트캠프 32일차 TIL 개인과제 깃허브 제출 (0) | 2023.08.10 |
23.08.08 부트캠프 30일차 TIL 레지스터 사용 (0) | 2023.08.08 |
23.08.07 부트캠프 29일차 TIL (0) | 2023.08.07 |
23.08.06 부트캠프 28일차 WIL (0) | 2023.08.06 |