android:drawableLeft margin and/or padding

后端 未结 18 2244
猫巷女王i
猫巷女王i 2020-11-27 09:29

Is it possible to set the margin or padding for the image which we added with the android:drawableLeft?

18条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-27 09:56

    You can use android:drawableLeft="@drawable/your_icon" to set the drawable to be shown on the left side. In order to set a padding for the drawable you should use the android:paddingLeft or android:paddingRight to set the left/right padding respectively.

    android:paddingRight="10dp"
    android:paddingLeft="20dp"
    android:drawableRight="@drawable/ic_app_manager"
    

提交回复
热议问题