Câu hỏi này đã được hỏi here, nhưng không có giải pháp.Tại sao thuộc tính minHeight không hoạt động trong WebView Android?
Tôi có một số WebView
. Tôi muốn đặt chiều cao tối thiểu là WebView
bằng thuộc tính minHeight
nhưng không hoạt động. Các thuộc tính tương tự hoạt động cho Button.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.anshul.webview.WebActivity">
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="400dp"></WebView>
<Button
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 !!"/>
Rõ ràng từ hình ảnh dưới đây, WebView không hỗ trợ thuộc tính minHeight
. Có ai biết một giải pháp cho vấn đề này?
trong đó phiên bản Android bạn gặp vấn đề này? – savepopulation
Tôi đã thử nó trên Android 25 và phải đối mặt với vấn đề này. Nhưng tôi nghĩ nó không liên quan đến phiên bản Android. – thedarkpassenger
có một số vấn đề về webview trong các phiên bản kat trước bộ. vì vậy tôi hỏi. – savepopulation