Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/191.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 安卓在图像上添加文本,效果良好_Android - Fatal编程技术网

Android 安卓在图像上添加文本,效果良好

Android 安卓在图像上添加文本,效果良好,android,Android,世界!我是一名学生,正在开发一个关于我的国家的Android应用程序。我注意到一个应用程序中有一个漂亮的布局。 在这张图片中,文本视图位于背景优美的图片底部(有点渐变) 我想知道你是否能帮我弄清楚怎么做或者给我指明方向。 目前我所拥有的一切是: row.xml 谢谢 实际上,您可以使用GradientDrawable作为RelativeLayout的背景,以保存您的TextViews 渐变可以如下所示: <RelativeLayout android:layout_width

世界!我是一名学生,正在开发一个关于我的国家的Android应用程序。我注意到一个应用程序中有一个漂亮的布局。

在这张图片中,文本视图位于背景优美的图片底部(有点渐变) 我想知道你是否能帮我弄清楚怎么做或者给我指明方向。 目前我所拥有的一切是: row.xml



谢谢

实际上,您可以使用
GradientDrawable
作为
RelativeLayout
的背景,以保存您的
TextView
s

渐变可以如下所示:

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:layout_alignParentBottom="true"
    android:background="@drawable/my_custom_gradient.xml">
my\u custom\u drawable.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient
        android:angle="90"
        android:endColor="@android:color/transparent"
        android:startColor="@android:color/black" />
</shape>
这将导致:

当然,您需要在
GradientDrawable
中使用各种颜色,使其适合您的需要。我不能告诉你什么颜色适合你的需要

您还可以添加
中心色
-有关更多属性,请参阅


我可能会将字幕textcolor更改为与标题textcolor相同的颜色。

非常感谢:)这对我很有帮助!很抱歉,我不能投票给你的答案,因为我的评分不够。@Zhadyrassyndaniya没问题:-)我认为你仍然可以接受这个答案,尽管没有任何声誉:-)很有帮助。谢谢
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:layout_alignParentBottom="true"
    android:background="@drawable/my_custom_gradient.xml">