Android 如何将webview宽度和高度与内容匹配(此处为gif文件)
我正在尝试在web视图中显示gif文件,并在web视图周围创建一个九补丁照片(作为框架)。但始终web视图及其框架会填充父宽度。但我需要框架在gif文件周围精确显示,无需任何额外空间,这是我的代码:Android 如何将webview宽度和高度与内容匹配(此处为gif文件),android,webview,gif,Android,Webview,Gif,我正在尝试在web视图中显示gif文件,并在web视图周围创建一个九补丁照片(作为框架)。但始终web视图及其框架会填充父宽度。但我需要框架在gif文件周围精确显示,无需任何额外空间,这是我的代码: <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" android:foreground="@drawable/frame_tir3" xm
<FrameLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:foreground="@drawable/frame_tir3"
xmlns:android="http://schemas.android.com/apk/res/android">
<WebView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/web1"/>
</FrameLayout>
我尝试了很多不同的代码,但都不起作用