Understanding Android's <layer-list>

前端 未结 2 1598
余生分开走
余生分开走 2020-11-28 05:36

I don\'t understand how the layer-lists work. I read the official documentation with some examples but it does not work for me like expected. I want four squares which shoul

2条回答
  •  囚心锁ツ
    2020-11-28 06:27

    Either you use px instead of dp or multiply all dimensions by 10.

    I'm ashamed to admit that I don't exactly know WHY this is happening but my guess is that it has something to do with densities where 1dp is a floating px value and the ImageView is scaled up.

    Expert answer is welcomed :)

提交回复
热议问题