I can add a back button on the toolbox but here it is as transparent.我可以在工具箱上添加一个后退按钮,但在这里它是透明的。But how to add such back button to MainActivity layout?但是如何将这样的后退按钮添加到 MainActivity 布局中呢?
1 个解决方案
解决方案1
1 2022-10-01 15:09:16
Try this -尝试这个 -
Set theme NoActionBar to your MainActivity将主题 NoActionBar 设置为您的 MainActivity
Create custom action bar with custom required back button使用自定义所需的后退按钮创建自定义操作栏
add onClick listener on that back button and call the finish() function to achieve back functionality.在该后退按钮上添加 onClick 侦听器并调用 finish() function 以实现后退功能。