gpt4 book ai didi

android - 为什么影子没有出现?

转载 作者:太空宇宙 更新时间:2023-11-03 11:40:41 26 4
gpt4 key购买 nike

文本出现了,@color/blue 在代码的其他地方都很好,还有什么阻止阴影出现?我已经为 shadowDxshadowDy 以及 shadowRadius 尝试了 1、10 和 100 的值。阴影既没有出现在编辑器中(这显然是预期的 TextView shadow not showing up in preview - although working on real device )也没有出现在我的手机上,这是我的测试设备。

    <TextView
android:id="@+id/shadow_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="i should be shadowed ..."
android:textColor="@android:color/white"
android:shadowColor="@color/blue"
android:shadowRadius="2"
android:shadowDx="1"
android:shadowDy="1"
android:textSize="@dimen/text" />

最佳答案

它仅在我使用浮点值时才适用。试试这个:

 <TextView
android:id="@+id/shadow_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="i should be shadowed ..."
android:textColor="@android:color/white"
android:shadowColor="@color/blue"
android:shadowRadius="2.0"
android:shadowDx="1.0"
android:shadowDy="1.0"
android:textSize="@dimen/text" />

是的,编辑器没有显示阴影,但它也应该显示一条注释,表明它不受支持。

关于android - 为什么影子没有出现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10670630/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com