0
我有一个活动,几个按钮和web视图。我想在按下特定按钮时将webview设置为全屏幕,并且在webview被双击时从全屏模式退出。 这是XML:将webview设置为全屏其他控制器
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageButton
android:id="@+id/ibNext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_action_previous_item" />
<ImageButton
android:id="@+id/ibPrevious"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_action_next_item" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right" >
<ImageButton
android:id="@+id/ibFullScreen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_action_full_screen" />
<ImageButton
android:id="@+id/ibChapters"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_action_view_as_list" />
</LinearLayout>
</LinearLayout>
<WebView
android:id="@+id/webView1"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</LinearLayout>
我已经为全屏按钮的监听器,我只需要知道如何web视图设置为全屏。
感谢
谢谢您的回答。我用你的答案,现在全屏按钮传播按钮区域上的webview,但ActionBar仍然存在。我怎样才能将WebView传播到ActionBar的区域呢? – rafraph
我更新了我的回答,现在按照您的需要试用它。 –
再次感谢您,但ActionBar的更新适用于API级别11和更高级别。我需要它为API级别7。你知道在API级别7中执行此操作的方式是什么? – rafraph