android 字体
来源:互联网 发布:淘宝客服英文怎么说 编辑:程序博客网 时间:2024/05/17 04:45
http://wenku.baidu.com/view/2d24be10cc7931b765ce155b.html
remoteview 的字体问题:http://blog.sina.com.cn/s/blog_7d22784d0101kfjm.html
关于 RemoteView 的一些字体的一些问题
(2013-05-09 15:54:14)转载▼
标签:
it
android
分类:android理解最近在做一个 在notification 添加 天气通知的小部分
发现困扰在 如何给 RemoteView 中的字体 作修改 。
大家都知道 , textView 设置字体 在XML 中 可以 设置 3种
具体:
将字体放置在asset 文件夹中
Typeface face =Typeface.createFromAsset(this.getAssets(),"helvetica-neue-lt.ttf");
textView.setTypeface(face);
BUT------------------------------>然后就是重点了
RemoteView
然后查资料 , 找到这么一个方法
RemoteView中需要改字体的textView ,改使用ImageView
然后
public Bitmap buildUpdate(String time) { Bitmap myBitmap = Bitmap.createBitmap(160, 84, Bitmap.Config.ARGB_4444); Canvas myCanvas = new Canvas(myBitmap); Paint paint = new Paint(); Typeface clock = Typeface.createFromAsset(this.getAssets(),"Clockopia.ttf"); paint .setAntiAlias(true); paint .setSubpixelText(true); paint .setTypeface(clock); paint .setStyle(Paint.Style.FILL); paint .setColor(Color.WHITE); paint .setTextSize(65); paint .setTextAlign(Align.CENTER); myCanvas .drawText(time, 80, 60, paint); return myBitmap; }
在然后:去使用这个BitmapString time = (String) DateFormat.format(mTimeFormat, mCalendar);RemoteViews views = new RemoteViews(getPackageName(), R.layout.main);views.setImageViewBitmap(R.id.TimeView, buildUpdate(time));
- Android字体
- android 字体
- android 字体
- android 字体
- android 字体
- android 字体
- Android 字体
- Android 字体
- Android 字体
- 关于android 字体
- Android 使用自定义字体
- Android中字体加粗
- android 自带字体
- android 使用其他字体
- Android开发:自定义字体
- android 字体的使用
- Android自定义字体
- Android字体简介
- C语言如何将每行代码限制在80个字符
- Zookeeper-solrCloud-tomcat整合部署
- android SharedPreferences(参数保存)
- 数据库基础-sql_(一)
- android 调用系统日历
- android 字体
- 【牛腩新闻发布系统】之CSS总结
- module_init分析
- file_get_contents 增加超时的时间限制
- 监听程序未启动或数据库服务未注册到该监听程序
- lua中的特殊语法,较基础
- HTTP详解-工作原理
- html 5标签
- c#中DllImportAttribute用法汇总