【问题标题】:Shadow is not working on the textview. How to fix it?阴影不适用于文本视图。如何解决?
【发布时间】:2020-08-21 08:56:55
【问题描述】:

我已经尝试了很多次,也尝试了所有方法来使文本发光。 但它不起作用。

请看图片。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
    android:background="#05090B"
    tools:context=".FullscreenActivity">
    <TextView
        android:id="@+id/text"
        android:textColor="#16C61F"
        android:layout_centerInParent="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="41dp"
        android:text="INAM"
       android:shadowColor="@android:color/white"
        android:shadowDx="0"
        android:shadowDy="0"
        android:shadowRadius="5"
        android:padding="15dp"/>

</RelativeLayout>

【问题讨论】:

  • 请插入您尝试过的代码,而不是发送它的图像。
  • 现在我已经完成了添加代码。你现在能解决这个问题吗?

标签: java android xml textview glow


【解决方案1】:

请使用 41sp 而不是 41dp,这样不会出错

【讨论】:

  • 引用一些文档来支持您的答案将极大地帮助 OP。
  • 其实我想点亮我的textview。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-05-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多