Change background color of edittext in android

前端 未结 10 1696
一个人的身影
一个人的身影 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:27

    This is my working solution

    View view = new View(getApplicationContext());
    view.setBackgroundResource(R.color.background);
    myEditText.setBackground(view.getBackground());
    

提交回复
热议问题