回答編集履歴
1
説明追加
answer
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
> 3. プレビュー画面と実行画面が違う
|
9
9
|
|
10
|
-
これはButtonのz位置指定が反映されていないことによるものです。API21以降ではButtonの `android:stateListAnimator` 属性にz位置を変更する[animatorリソース](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/anim/button_state_list_anim_material.xml)が指定されているので、 elevationやtranslationZを指定しても上書きされてしまって反映されません。
|
10
|
+
これは実行時にButtonのz位置指定が反映されていないことによるものです。API21以降ではButtonの `android:stateListAnimator` 属性にz位置を変更する[animatorリソース](https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/anim/button_state_list_anim_material.xml)が指定されているので、 elevationやtranslationZを指定しても上書きされてしまって反映されません。
|
11
11
|
|
12
12
|
リソースファイルの内容によれば、Buttonのz位置は非選択状態では
|
13
13
|
`elevation 2dp + tranlationZ 0dp => 2dp`
|