【发布时间】:2013-12-18 15:30:39
【问题描述】:
我有一个带有几个按钮和 web 视图的活动。我想在按下特定按钮时将 webview 设置为全屏,并在双击 webview 时退出全屏模式。 这是 XML:
<?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>
我已经有一个全屏按钮的监听器,我只需要知道如何将 webview 设置为全屏。
谢谢
【问题讨论】:
标签: android webview fullscreen