Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望按钮看起来好像在它的脸底部和画布之间有空间。然后,当单击时,它看起来好像按钮和画布之间没有空间。我知道我可以使用 xml 为按钮设置样式以赋予它两种外观,但我不知道如何进行提升外观。
我的问题是如何去做这件事?
最简单的方法是创建 2 个背景图像,每个都适合您想要的状态,然后您可以根据按钮的状态设置背景,或者通过为按钮设置 onTouchListener 来更改背景。