코틀린-버튼컬러 액션

  1. 리소스xml 파일 생성 후 아래내용 참고(res/color/btn가정)
    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android">
        <item android:color="#ffff0000" android:state_pressed="true"/>
        <item android:color="#ff0000ff" android:state_focused="true"/>
        <item android:color="#ff000000" />
    </selector>
  2. 액티비티 xml에서 아래내용 참고
    <Button
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="Click"
        android:textColor="@color/btn"/>

Keep Reading

이전다음

댓글

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다