为什么没有出现阴影? [英] Why isn't shadow appearing?

查看:177
本文介绍了为什么没有出现阴影?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显示的文本,而 @色/蓝色是罚款在code在其他地方,还有什么是preventing出现的影子?我已经试过值1,10,和100的 shadowDx &安培; shadowDy 以及 shadowRadius 。阴影不会出现无论是在编辑器(这显然有望 TextView的阴影没有出现在preVIEW - 尽管真实设备工作)或我的电话,这是我的测试设备上。

 <的TextView
        机器人:ID =@ + ID / shadow_text
        机器人:layout_width =FILL_PARENT
        机器人:layout_height =WRAP_CONTENT
        机器人:比重=中心
        机器人:文字=我应该被隐藏。
        机器人:文字颜色=@机器人:彩色/白
        安卓则shadowColor =@色/蓝
        机器人:shadowRadius =2
        机器人:shadowDx =1
        机器人:shadowDy =1
        机器人:TEXTSIZE =@扪/文本/>


解决方案

这只有当我使用浮点值对我的作品。试试这个:

 <的TextView
        机器人:ID =@ + ID / shadow_text
        机器人:layout_width =FILL_PARENT
        机器人:layout_height =WRAP_CONTENT
        机器人:比重=中心
        机器人:文字=我应该被隐藏。
        机器人:文字颜色=@机器人:彩色/白
        安卓则shadowColor =@色/蓝
        机器人:shadowRadius =2.0
        机器人:shadowDx =1.0
        机器人:shadowDy =1.0
        机器人:TEXTSIZE =@扪/文本/>

和肯定的,编辑器不会显示的影子,但它也应该表现出注意的是不支持的。

The text appears, and the @color/blue is fine elsewhere in the code, what else is preventing the shadow from appearing? I have tried values of 1, 10, and 100 for the shadowDx & shadowDy as well as shadowRadius. The shadow does not appear either in the editor (which apparently is expected TextView shadow not showing up in preview - although working on real device) or on my phone, which is my testing 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" />

解决方案

It only works for me if I use float values. Try this:

 <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" />

And yes, the editor doesn't show the shadow, but it should also show a note that it isn't supported.

这篇关于为什么没有出现阴影?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆