How to get a Button's background back to default (programmatically)?

前端 未结 6 1194
别跟我提以往
别跟我提以往 2020-12-30 21:06

So I\'m setting a button\'s background doing this:

b.setBackgroundResource(R.drawable.custom_button1);

How do I programmatically set it bac

6条回答
  •  有刺的猬
    2020-12-30 21:43

    try

    button.setBackgroundResourses(R.drawable.yourimage);
    

    it will set the default background of buttons. and you can read more default properties of android widgets from given link: https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml

提交回复
热议问题