有没有办法在ImageView中设置图像的特定部分(如图像的1/4)的色调。我想用TextView在ImageView上命名这些图像,但是很难在图像上读取文本,所以我想使用带有黑色(白色)的图像的底色,.is有什么方法可以做到吗?
发布于 2014-11-04 07:18:17
您可以使用包含一个imageview的相对布局,然后在Imageview后设置一个文本视图,然后textview将在图像视图上设置您想要的文本视图,还可以设置所需颜色的文本视图的背景和文本视图的文本颜色,这将是textview项的写入颜色。快乐编码
![<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@drawable/akash"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/image"
android:background="#000000"
android:textColor="#ffffff"
android:text="akash jindal"
android:gravity="center"/>
</RelativeLayout>][1]https://stackoverflow.com/questions/26729102
复制相似问题