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.
我有一个应用程序,并且我设法在操作栏中为主页按钮添加了一个图像。
我使用 actionbar.setIcon() 方法做到了这一点。
该图像本质上是一个空白按钮图像。我希望能够在图像顶部添加文本“退出”。有没有办法做这样的事情?
我做了一个解决方法。我使用以下方法隐藏了主页按钮:
Actionbar.setDisplayShowHomeEnabled(false);
然后在操作栏上添加了一个按钮,按钮上有图像和文本。
到目前为止我不知道。但是您可以使用文本“退出”直接制作图像按钮