【发布时间】:2013-11-09 22:41:08
【问题描述】:
我正处于 android 的学习阶段。我想在 ImageView 上设置 TextView。我不明白。我会很感激的。这是我的 XML 代码。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="380dp"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:background="@drawable/wf" />
<TextView
// what should i add here so that it can be visible on image view//
/>
</LinearLayout>
【问题讨论】:
-
你的意思是你想把一个TextView放在一个ImageView的fromt中吗?您不能简单地使用 LinearLayout 来做到这一点,因为这会将所有视图并排排列。
-
这没有意义。视图不能既是文本视图又是图像视图。如果要合并视图,可以使用视图组。
-
不在图像视图前面,而我想在 ImageView 上设置 TextView...?
-
你能说得更具体点吗?
-
我通过 ImageView 添加了一张图片。现在我想在同一张图片上添加一些随机更改的文字...如何在所述图片上添加/设置 TextView....??希望你明白了
标签: android