search

Home  >  Q&A  >  body text

android - 两行文字是用两个TextView还是用一个TextView然后文字折行啊

两行文字是用两个TextView还是用一个TextView然后文字折行啊
是不是尽量少增加控件比较好

PHP中文网PHP中文网2772 days ago561

reply all(1)I'll reply

  • 高洛峰

    高洛峰2017-04-17 17:38:21

    Look at the layout, for example, if you just print multiple lines of logs, a TextView.
    If you want a more flexible or complex layout, just use two TextViews for easy operation.

    If it is just for a simple control like TextView, there is no difference in performance between one and two. Most of the optimizations are aimed at the order of magnitude difference. Complex controls, data and layouts are cached so they load more smoothly.

    Of course, controlling the number of controls is also an art. Finding performance bottlenecks based on the actual situation is more targeted. When the user experience is acceptable, of course maintenance and other aspects must also be considered. . .

    reply
    0
  • Cancelreply