Change background color of edittext in android

前端 未结 10 1666
一个人的身影
一个人的身影 2020-12-25 12:00

If I change the background color of my EditText using the below code, it looks like the box is shrunken and it doesn\'t maintain the ICS theme of a blue bottom

10条回答
  •  执念已碎
    2020-12-25 12:31

    The simplest solution I have found is to change the background color programmatically. This does not require dealing with any 9-patch images:

    ((EditText) findViewById(R.id.id_nick_name)).getBackground()
        .setColorFilter(Color., PorterDuff.Mode.MULTIPLY);
    

    Source: another answer

提交回复
热议问题