Androidでボタンの影を消す方法
ボタンの影を消す方法は2通りあるので順に説明してきます。
stateListAnimatorをnullにする方法
stateListAnimatorでボタンの影が定義されているので、これをnullにすると影が消えます。
binding.sampleButton.setStateListAnimator(null);
xmlのstyleにborderlessButtonStyleを設定する
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
style="?android:attr/borderlessButtonStyle"
android:id="@+id/sampleButton" />
スポンサーリンク