2

在 Honeycomb 中,图书操作栏在用户点击屏幕时淡入/淡出,在其他布局内容上出现/消失。

这是怎么做到的?

4

2 回答 2

2

将此设置为您的应用程序或活动主题:

<style name="Theme.OverlayActionBar" parent="android:Theme.Holo.Light">
    <item name="windowActionBarOverlay">true</item>
</style>

然后你可以使用ActionBar.hide()and 和show()Berdons 的答案一样。

于 2011-08-07T07:35:20.757 回答
0

您可以使用( Source )以编程方式添加/隐藏 ActionBar :

ActionBar actionBar = getActionBar();
actionBar.hide();
actionBar.show();

编辑:

您甚至可以从父级中提取 ActionBar 视图并重新添加它,使其“浮动”(RelativeLayout 作为容器)。

编辑3:

嗯...如何在您的活动布局上使用负上边距然后使用显示/隐藏?

于 2011-08-06T18:42:25.150 回答