Android Text Below Icon (button)

前端 未结 1 911
南笙
南笙 2021-02-19 22:14

I am trying to create a main entry interface. I will create a six buttons, and each button will open another activity. For each button, I want it have an big icon with text belo

相关标签:
1条回答
  • 2021-02-19 22:41

    Use drawableTop attribute as follows:

    <Button
        android:id="@+id/btn2"
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:text="This text is below the image"
        android:drawableTop="@drawable/ic_my_icon2" /> 
    

    See the reference android:drawableTop and this simple example on Button documentation with drawableLeft.

    0 讨论(0)
提交回复
热议问题