首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

替数字添加LCD效果

2012-08-25 
为数字添加LCD效果我们有时想为数据添加LCD效果,例如实现计时器时,我们想实现类似LCD显示屏那样的跳动效果

为数字添加LCD效果

我们有时想为数据添加LCD效果,例如实现计时器时,我们想实现类似LCD显示屏那样的跳动效果,如图

?

首先,我们需要在assets目录下创建一个ttf文件fonts\lcd2mono.ttf

?

?

在android代码中如下使用

txtMineCount = (TextView) findViewById(R.id.MineCount);txtTimer = (TextView) findViewById(R.id.Timer);// set font style for timer and mine count to LCD styleTypeface lcdFont = Typeface.createFromAsset(getAssets(),"fonts/lcd2mono.ttf");txtMineCount.setTypeface(lcdFont);txtTimer.setTypeface(lcdFont);

?

?

1 楼 vanlzh 2011-09-19   不错,正需要

热点排行