我想將webview添加到我的layout.But該佈局也有其他窗口小部件。但是,當我運行應用程序時,webview將整個屏幕和其他窗口小部件消失。這裏是我的佈局page.xml ....如何將webview添加到具有更多窗口小部件的佈局
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" >
<WebView android:layout_width="match_parent" android:layout_height="200dp" android:id="@+id/web"></WebView>
<View android:layout_marginTop="10dp" android:layout_marginBottom="10dp" android:layout_height="2px" android:background="#ffffff" android:layout_width="fill_parent" ></View>
<TextView android:text="Simple text view" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
</LinearLayout>
,並在活動課
setContentView(R.layout.page);
WebView wv1=(WebView)findViewById(R.id.web);
wv1.loadUrl("http://google.com");
它不顯示視圖和TextView的,但web視圖得到整個screen.Please告訴我什麼我我在這裏做錯了什麼,或者我應該做的正確方法是什麼。 謝謝。
在這裏你可以找到答案http://stackoverflow.com/questions/3382188/how-to-set-webview-as-non-fullscreen –
感謝侯賽因,我認爲重定向使問題作爲CommonsWare說那裏。 google.com重定向到google.lk,然後瀏覽器讓我發瘋。 – sampathpremarathna