我有一個標籤菜單使用ViewPager
。每個選項卡都包含android.support.v4包中的片段(與舊SDK兼容)。其中一個片段是WebView
(稱爲FragmentWeb
),我希望它保留在尋呼機佈局中。問題是當我的WebView
充氣時,它以全屏模式運行。WebView到片段(android.support.v4)
有沒有辦法讓網頁瀏覽器保持在我的標籤下?
謝謝
我的片段類:FragmentWeb.java
public class FragmentWeb extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View mainView = (View) inflater.inflate(R.layout.fragment_web, container, false);
WebView webView = (WebView) mainView.findViewById(R.id.webview);
webView.loadUrl("http://www.google.com");
return mainView;
}
}
我的碎片的佈局:fragment_web.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>