如何计算TextView
呈现一行文字所需的时间?
textView.setText("hello");
答案 0 :(得分:1)
您可以扩展TextView类并覆盖draw:
@Override
public void draw(Canvas canvas) {
//log start time
super.draw(canvas);
//log end time
}
答案 1 :(得分:0)
在eclipse中使用Android Traceview
答案 2 :(得分:0)
@Maxim的替代方法是在setText("hello");
Log.i(logTag, "start time");
textView.setText("hello");
Log.i(logTag, "end time");
如果仅在调用setText
之后呈现视图,则此操作无效。也许有人可以在评论中确认或否认。