Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] 자주 쓰이는 버튼 Style 지정 #32

Open
4z7l opened this issue Jan 7, 2021 · 1 comment
Open

[DOCS] 자주 쓰이는 버튼 Style 지정 #32

4z7l opened this issue Jan 7, 2021 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@4z7l
Copy link
Member

4z7l commented Jan 7, 2021

image

자주 쓰이는 버튼 Style을 themes.xml 파일에 지정해 놓았습니다

style 속성 사용 전

  • 일일이 모든 속성을 지정해 주어야함
        <androidx.appcompat.widget.AppCompatButton
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:background="@drawable/selector_btn_sign_in"
            android:text="@string/msg_store"
            android:textSize="18sp"
            android:textStyle="bold"
            android:textColor="@color/white" />

style 속성 사용 후

  • android:text 속성만 지정해주면됨
        <androidx.appcompat.widget.AppCompatButton
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:text="@string/msg_store"
            style="@style/MyDailyButtonStyle" />

Style 내용

    <style name="MyDailyButtonStyle" parent="Widget.AppCompat.Button">
        <item name="android:textSize">18sp</item>
        <item name="android:textStyle">bold</item>
        <item name="android:textColor">@color/white</item>
        <item name="android:background">@drawable/selector_btn_sign_in</item>
    </style>
@4z7l 4z7l added the documentation Improvements or additions to documentation label Jan 7, 2021
@4z7l
Copy link
Member Author

4z7l commented Jan 7, 2021

관련 커밋
5da1f2f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant