以编程方式将文本添加到android中的图像 [英] Add text to image in android programmatically

查看:19
本文介绍了以编程方式将文本添加到android中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个应用程序,就像 android 的打开屏幕一样.我正在动态地将图像添加到 tableLayout 的行中.我只在 xml 文件中定义了 tableLayout,其余代码在 java 中.我已成功添加图像,但在设置该图像的文本(我想在图像下显示文本)和图像设置为特定填充方面没有任何帮助.如何做到这一点?提前致谢.

I want to make an application just like opening screen of android.I am dynamically adding images to the rows of tableLayout. I have only defined tableLayout in xml file and remaining code is in java. I have added images successfully but i am not getting any help with setting text of that image (I want to display a text under image) and image to be a specific padding.How to do it?Thanks in advance.

推荐答案

您可以做的是使用RelativeLayout 将TextView 叠加到ImageView :)

What you can instead do is to put a TextView in overlay to a ImageView using a RelativeLayout :)

这篇关于以编程方式将文本添加到android中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆