Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/195.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 如何将imageview设置为背景?_Android_Background_Imageview - Fatal编程技术网

Android 如何将imageview设置为背景?

Android 如何将imageview设置为背景?,android,background,imageview,Android,Background,Imageview,我是android studio的新手,不知道如何将Imageview设置为背景 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" andr

我是android studio的新手,不知道如何将Imageview设置为背景

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1"
>

<ImageView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:srcCompat="@android:drawable/arrow_up_float"
    android:id="@+id/imageViewFull" />


您无需添加图像视图即可将图像设置为背景。您可以通过添加
android:background=“@drawable/background\u image”
添加到布局标记

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
               xmlns:app="http://schemas.android.com/apk/res-auto"
               android:orientation="vertical"           
               android:layout_width="match_parent"
               android:layout_height="match_parent"
               android:weightSum="1"
       android:background="@drawable/background_image">

参考此问题了解其他方法

您无需添加图像视图即可将图像设置为背景。您可以通过添加
android:background=“@drawable/background\u image”
添加到布局标记

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
               xmlns:app="http://schemas.android.com/apk/res-auto"
               android:orientation="vertical"           
               android:layout_width="match_parent"
               android:layout_height="match_parent"
               android:weightSum="1"
       android:background="@drawable/background_image">

参考此问题了解其他方法

谢谢您的帮助谢谢您的帮助此解决方案有很多链接此解决方案有很多链接