添加文本的ImageView Android中 [英] Adding text to ImageView in Android
本文介绍了添加文本的ImageView Android中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
喜 我有一个ImageView的。我想说明的显示在奇特的方式一些消息,这个图像显示。 所以我想添加文本到ImageView的。 谁能告诉我怎样才能做到这一点。
Hi I have one ImageView. I want to show this image view for showing some message in fancy way. So I want to add text to that ImageView. Can Anybody tell me how can I do this.
推荐答案
要一个文本添加到您的的ImageView
,你可以这样做:
To add a text to your ImageView
you can do this:
<RelativeLayout> // Only works inside a RelativeLayout
<ImageView
android:id="@+id/myImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/myImageSouce" />
<TextView
android:id="@+id/myImageViewText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/myImageView"
android:layout_alignTop="@+id/myImageView"
android:layout_alignRight="@+id/myImageView"
android:layout_alignBottom="@+id/myImageView"
android:layout_margin="1dp"
android:gravity="center"
android:text="Hello"
android:textColor="#000000" />
</RelativeLayout>
这篇关于添加文本的ImageView Android中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文