试试:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView webView = (WebView)findViewById(R.id.webView);
webView.loadDataWithBaseURL(null, "
hehehe ", "text/html", "utf-8", null);}
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@color/blue"
android:layout_height="match_parent">
android:minHeight="300dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
>
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:minHeight="150dp"
android:text="This is a Button. It's minHeight is set to 150 dp and it works !!"/>