์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- ์ฝํ๋ฆฐ
- Filter
- ์๊ณ ๋ฆฌ์ฆ ์ธ์ฆ
- ๋ค์์ ๋ฆฌํ๊ธฐ
- iPortfolio
- foldindexed
- filternot
- ์ทจ์ค๊ธฐ๋ก
- ์ฝ๋ฉํ ์คํธ
- ๋ค์ ์ ๋ฆฌํด์ผํจ
- array๋ list
- ์๊ณ ๋ฆฌ์ฆ ์ธ์ฆ_2์ฃผ์ฐจ
- ์๊ณ ๋ฆฌ์ฆ ์ธ์ฆ_1์ฃผ์ฐจ
- recyclerview
- ๋ค์๋ด
- Today
- Total
Moments of growth
[Kotlin] AppCompatButton ์ด๋ฏธ์ง ๋ฃ๊ธฐ + ๋ฒํผ ์์ ์์ ๊ธฐ ๋ณธ๋ฌธ
[Kotlin] AppCompatButton ์ด๋ฏธ์ง ๋ฃ๊ธฐ + ๋ฒํผ ์์ ์์ ๊ธฐ
๋ฎค๋ง์ด 2021. 11. 19. 21:32
๐fragment_inhome.xml
- AppCompatButton์ ์ ์ฒด ์ฝ๋
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_create"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="19dp"
android:layout_marginTop="27dp"
android:layout_marginEnd="19dp"
android:background="@drawable/rectangle_blue"
android:defaultFocusHighlightEnabled="true"
android:drawableStart="@drawable/ic_headset"
android:drawablePadding="-117dp"
android:fontFamily="@font/applesdcothicneo"
android:paddingLeft="117dp"
android:stateListAnimator="@null" //๋ฒํผ ์์ ์์ ๊ธฐ
android:text="@string/create"
android:textColor="@color/white"
android:textSize="15sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/rv_popularity" />
๐์์ ์ฝ๋ ์ค์์ ์ด๋ฏธ์ง๋ ํ ์คํธ ๊ฐ์ด ๋ฃ๊ณ ์์น ์กฐ์ ํ๋ ์ฝ๋ + ๋ฒํผ ์์ ์์ ๋ ์ฝ๋
android:drawableStart="@drawable/ic_headset"
android:drawablePadding="-117dp"
android:text="@string/create"
android:paddingLeft="117dp"
android:stateListAnimator="@null" //๋ฒํผ ์์ ์์ ๊ธฐ
drawableStart๋ก ์์ด์ฝ์ ๋ฃ์ด์ค๋ค.

์ฌ๊ธฐ์ drawablePadding์ผ๋ก ์์๊ฐ์ธ -117dp๋ฅผ ์ค์ ํ๋ฉด

๋ง์ง๋ง์ผ๋ก paddingLeft๋ก 117dp๋ฅผ ์ค์ ํด์ฃผ๋ฉด
์ ์ฒด์ ์ผ๋ก ๊ฐ์ด ์ค๋ฅธ์ชฝ์ผ๋ก 117dp๋งํผ ์ด๋๋ผ์ ์๋ฒฝํ๊ฒ ๊ตฌํ๋๋ค.

๋ฒํผ ์์์ stateListAnimator="@null"๋ก ์์ ์ฃผ๋ฉด ๋๋ค.
[์ฐธ๊ณ ์๋ฃ] https://recipes4dev.tistory.com/104
์๋๋ก์ด๋ ์ด๋ฏธ์ง ๋ฒํผ์ ์์ด์ฝ ์ด๋ฏธ์ง ์ถ๋ ฅํ๊ธฐ. (Android Image Button with a Icon Image)
1. ์ด๋ฏธ์ง ๋ฒํผ์ ์ด๋ฏธ์ง์ ํ ์คํธ ์กฐํฉํ๊ธฐ. ์ง๋ ๊ธ [๊ฐ๋ฐ์ ๋ ์ํผ - ์๋๋ก์ด๋ ์ด๋ฏธ์ง ๋ฒํผ์ ํ ์คํธ ์ถ๋ ฅํ๊ธฐ]์ ์ด์ด, ์ด๋ฏธ์ง ๋ฒํผ์ ์์ด์ฝ ํํ์ ์ด๋ฏธ์ง๋ฅผ ์ถ๋ ฅํ๋ ๋ฐฉ๋ฒ์ ๋ํด ์์
recipes4dev.tistory.com
[Android] ์๋๋ก์ด๋ ๋ฒํผ ์์ ์ ๊ฑฐ(Remove button shadow on Android)
์๋๋ก์ด๋ ๋ฒํผ์ ์์์ ์ ๊ฑฐํ ํ์๊ฐ ์์ ๋๊ฐ ์๋ค. xml ํ์ผ์ button ์์ฑ ๊ฐ์ ์ถ๊ฐํ๊ฒ ๋๋ฉด ๊ฐ๋จํ๊ฒ ํด๊ฒฐ ๋๋ค.. android:stateListAnimator="@null"
fimtrus.tistory.com
'Android [Kotlin] ๐ป๐ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Kotlin] EditText์์ ํด๋ฆญ์ด๋ ์์ ๋ง๊ธฐ (0) | 2021.11.19 |
---|---|
[Kotlin] ScrollView ๋งจ์๋ก ๋ฒํผ ๋๋ฅด๋ฉด ์๋จ์ผ๋ก ๊ฐ๊ธฐ (0) | 2021.11.19 |
[Kotlin] ScrollView ์์ RecyclerView ๋ง๋๋ ๋ฐฉ๋ฒ (0) | 2021.11.19 |
[Kotlin] TabLayout swipe ๋ง๊ธฐ (0) | 2021.11.19 |
[Kotlin] RecyclerView ๊ฐ๋ก ๋ชจ๋๋ก ๊ตฌํ (0) | 2021.11.19 |