下面我们研究一下如何实现一个数字液晶时钟,本质属于特效一种哈。
首先创建一个布局文件:
对于阴影的几个属性我们引用一下别人博客里的内容:(http://blog.csdn.net/whoispo/article/details/8061907)
Android的TextView的XML属性中有关于阴影的几条属性
shadowDX、shadowDy、shadowRadius,说明分别是阴影的横、纵坐标偏移
首先创建一个布局文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id ="@+id/ledview_clock_time"
android:layout_width ="wrap_content"
android:layout_height ="wrap_content"
android:layout_centerInParent="true"
android:shadowColor ="#00ff00"
android:shadowDx ="0"
android:shadowDy ="0"
android:shadowRadius ="10"
android:textColor ="#00ff00"
android:textSize ="80sp" />
<TextView
android:id ="@+id/ledview_clock_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:text="@string/default_time"
android:textColor="#3300ff00"
android:textSize="80sp" />
</RelativeLayout>
对于阴影的几个属性我们引用一下别人博客里的内容:(http://blog.csdn.net/whoispo/article/details/8061907)
Android的TextView的XML属性中有关于阴影的几条属性
shadowDX、shadowDy、shadowRadius,说明分别是阴影的横、纵坐标偏移