Android 中的 TextView 可以显示数字文本吗?

发布于 2025-01-06 00:18:15 字数 118 浏览 3 评论 0原文

你好朋友,

在我的应用程序中,有一个要求,文本值应以数字文本格式显示,可以在TextView中执行(数字时钟如何显示) ?请提供任何帮助。

Hi friends,

In my application there is a requirement that the text values should be shown in a digital text format can it be possible to do in TextView (How digital clock shows)? Any help please.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

安静 2025-01-13 00:18:15

//从此链接下载字体并创建一个文件夹:将字体放入您的资源中,并将字体放入该文件夹中

或直接下载链接

Typeface tf = Typeface.createFromAsset(getAssets(),"fonts/digital_07.otf");
        TextView tv = (TextView) findViewById(R.id.digitalclock);
        tv.setTypeface(tf);

编辑:

我附上了项目链接

享受:-)

//download the font from the this link and create a folder as fonts inside your assets and put your font in that folder

or download direct link

Typeface tf = Typeface.createFromAsset(getAssets(),"fonts/digital_07.otf");
        TextView tv = (TextView) findViewById(R.id.digitalclock);
        tv.setTypeface(tf);

EDIT :

I attached the project link also

Enjoy :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文