前言
- 我们经常需要把一张图片显示在控件的某个方位,以便提升效果,谷歌也为我们提供了相应的属性和方法
使用
- android:drawableLeft
左边的图片 - android:drawableTop
底部的图片 - android:drawableRight
右边的图片 - android:drawableBottom
底部的图片
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<Button
android:id="@+id/mainButton1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android