单一 View 中的Android图像和文本

标签 android

我想在单个 View 中显示文本、图像。 也请帮助我 我想从我的类(class)而不是 xml 提供图像的 src 请帮助 谢谢

最佳答案

你可以为此使用Button

Button b=new Button(this);
b.setText(" Button");     
b.setCompoundDrawablesWithIntrinsicBounds(null, getResources().getDrawable(R.drawable.btn_call), null, null);

关于单一 View 中的Android图像和文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6613461/

相关文章:

java - Horizo​​ntalScrollView 与 EditText 向右跳转

android - 在 Api Map V2 Android 上绘制多边形时出现性能问题

android - 关于 ALSA 驱动 : How to handle Audio Devices correctly

java - 如何创建单个 volley webservice 类以在 Android 应用程序中使用?

Android:如何在SD卡上创建目录并将文件从/res/raw复制到其中?

android - 如何重现官方 Twitter 应用程序中的这些按钮?

java - Android Room 和继承。错误: Multiple fields have the same columnName

android - 带有文本选择控件的 float 工具栏

java - Android 从数组中随机动态改变背景

android - myEditText.setText 不在页面上刷新