如何通过代码设置drawableRight资源?
我试图在单击按钮后在按钮的右侧设置图像。我想通过代码来做到这一点。
我已经了解了如何通过代码更改背景资源,但我找不到任何示例来说明如何通过代码更改侧面。是否可以?
I am trying to set an image on the right side of my button after the button has been clicked. I want to do this via code.
I have seen how to change the background resource via code but I am not able to find any examples showing how to change the sides via code. Is it possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要使用带有 null 的方法。
对于任何不需要的内容,
You need to use the
method with null for any that are not needed.
通常您可以使用此更改
请注意您可能会错过按钮文本。
Usually you can change using this
Be aware you can miss the button text.