Android 如何将imageview设置为背景?
我是android studio的新手,不知道如何将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
<?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">
参考此问题了解其他方法
谢谢您的帮助谢谢您的帮助此解决方案有很多链接此解决方案有很多链接