gpt4 book ai didi

android - Webview 不适合带有操作栏的全屏

转载 作者:行者123 更新时间:2023-11-29 18:15:10 27 4
gpt4 key购买 nike

我想让 webview 全屏显示,上面有操作栏,底部有标准菜单栏。它在没有操作栏的情况下正确显示。当我打开它时,webview 的底部显示在底部菜单栏,我想将它放在两个菜单栏之间。它可能很容易修复,但找不到答案。谢谢!

代码:

ma​​in.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >


<WebView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layerType="software"
/>

</RelativeLayout>

settings.xml

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:id="@+id/group1">
<item android:id="@+id/opt" android:android:showAsAction="ifRoom|withText" android:enabled="true" android:title="Option 1" android:visible="true"></item>
<item android:id="@+id/opt2" android:showAsAction="ifRoom|withText" android:enabled="true" android:title="Option 2" android:visible="true"></item>

</group>

</menu>

Activity :

@Override
public boolean onCreateOptionsMenu(Menu menu) {

MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.settings, menu);
this.menu = menu;




getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
return true;
}

最佳答案

android:windowActionBarOverlay Declares whether the action bar should overlay the activity layout rather than offset the activity's layout position This is false by default.

When overlay mode is enabled, your activity layout has no awareness of the action bar laying on top of it.

有关 Actionbars 的更多信息,请阅读此处:http://developer.android.com/guide/topics/ui/actionbar.html

关于android - Webview 不适合带有操作栏的全屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8589859/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com