Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/221.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何将webview宽度和高度与内容匹配(此处为gif文件)_Android_Webview_Gif - Fatal编程技术网

Android 如何将webview宽度和高度与内容匹配(此处为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

我正在尝试在web视图中显示gif文件,并在web视图周围创建一个九补丁照片(作为框架)。但始终web视图及其框架会填充父宽度。但我需要框架在gif文件周围精确显示,无需任何额外空间,这是我的代码:

  <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>

我尝试了很多不同的代码,但都不起作用