要将AppCompatImageView的背景设置为Android 17,您可以使用以下步骤:
implementation 'androidx.appcompat:appcompat:1.3.0'
请注意,我们在android:background属性中使用了@drawable/android_17,这表示我们将在drawable文件夹中使用名为android_17的图像资源作为背景。
AppCompatImageView imageView = findViewById(R.id.imageView);
imageView.setBackgroundResource(R.drawable.android_17);
请注意,我们在setBackgroundResource()方法中使用了R.drawable.android_17作为参数,这将为AppCompatImageView设置名为android_17的图像资源作为背景。
这样,您的AppCompatImageView的背景就会被设置为Android 17图像资源。