安卓:隐藏动作条,随时查看动作

2023-09-12 02:32:49 作者:拿稳感情刀

要保持这种简单:我有卡在我的动作条,但操作栏占用太多的空间。我想这额外的空间。我需要一种方法来隐藏操作栏,但保持我的标签。反正有没有做到这一点?或者是有办法,我可以得到的选项卡内置在操作栏就像是在横向模式下?谢谢!

To keep this simple: I have tabs in my actionbar, but the action bar take up too much space. I want that extra space. I need a way to hide the action bar, yet keep my tabs. Is there anyway to do this? Or is there a way I can get the tabs built into the action bar like it is in landscape mode? Thanks!

推荐答案

您可以有一个空的动作条,那么选项卡将占用的空间:

You can have an empty Actionbar, then the tabs will occupy the space:

getSupportActionBar().setDisplayShowHomeEnabled(false);              
getSupportActionBar().setDisplayShowTitleEnabled(false);