1
我在WebView下顯示(並且最重要的是 - 保留)一個按鈕時遇到問題,所以它將停留在那裏,並且在調用loadUrl()後不會被WebView佔用。當模擬器啓動時,我可以在正確的位置看到按鈕,但是當頁面加載時,WebView始終佔據整個屏幕。 Android SDK爲1.5。在Android中的WebView下保留按鈕
這裏的佈局:
<RelativeLayout android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<Button android:text="Ok"
android:id="@+id/btnOk"
android:layout_width="120px"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"/>
<WebView android:id="@+id/webview1"
android:layout_above="@+id/btnOk"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</RelativeLayout>
我在上面的佈局改變唯一的事情是增加布局權重=」 1「並保持一切,但它的工作原理。或者我還應該改爲LinearLayout? – Demonick 2011-06-13 13:45:27
不。如果它按原樣運行,那麼請隨時堅持。我很高興它爲你解決了一些問題。 – 2011-06-13 13:46:51