【发布时间】:2016-08-29 11:58:52
【问题描述】:
我想将font family 设置为Textview
但我想在加载之前执行此操作xml
我的代码:
for(int i=0;i++;i<100000){
final View addNew = G.inflater.inflate(R.layout.post, null);
TextView txtTitle = (TextView) addNew.findViewById(R.id.txtTitle);
txtTitle.setText("" + i);
txtTitle.setTypeface(Typeface.createFromAsset(context.getAssets(),"tahoma.ttf"));
}
这段代码需要时间 15-16 秒
但如果我不使用setTypeface 需要时间 2-3 秒
【问题讨论】:
-
你是什么创造了文本视图的火箭>>>为什么你需要
100000 TextView