How to show the text on a ImageButton?

后端 未结 11 1441
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-04 08:42

I have an ImageButton and I want to show a text and an image on it. But when I try on emulator:



        
11条回答
  •  我在风中等你
    2020-12-04 09:20

    As you can't use android:text I recommend you to use a normal button and use one of the compound drawables. For instance:

    You can put the drawable wherever you want by using: drawableTop, drawableBottom, drawableLeft or drawableRight.

    UPDATE

    For a button this too works pretty fine. Putting android:background is fine!

    I just had this issue and is working perfectly.

提交回复
热议问题