本文介绍了如何增加图像(左)和文本按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在按钮添加图像(左)和文本?

How to add image(left) and text on button?

有关说明:

推荐答案

使用的android:DrawableLeft =@绘制/图像,在你的XML

您也可以从code做到这一点。

you can also do this from code

Drawable icon= getContext().getResources().getDrawable( R.drawable.image);
button.setCompoundDrawablesWithIntrinsicBounds( icon, null, null, null );

这篇关于如何增加图像(左)和文本按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 16:46
查看更多