margin inside the edit text in android

后端 未结 1 1853
时光取名叫无心
时光取名叫无心 2021-02-05 00:18

My question is : I have an EditText and I want set a margin inside the EditText, I mean margin for the content (the text) of the edit text, not a margin for a the view witch I c

1条回答
  •  一个人的身影
    2021-02-05 00:49

    The padding variable should be exactly what you are looking for. You should try to increase the padding to something like 10dp just to test if it does anything. I'm guessing that because the background of the EditText is a 9 patch the padding is not acting how you would expect. When you set padding on a view with a 9 patch as the background any padding that is built into the 9 patch is than ignored. So if the 9 patch has 5dp padding and you set 3dp padding in the xml you will not get 8dp padding you will get 3dp.

    0 讨论(0)
提交回复
热议问题