找到一个布局请求的原因在一个ViewGroup布局、原因、ViewGroup

由网友(污浊之眼)分享简介:我有一个包含在每个页面一RelativeLayout的一个发射状的侧面滚动定制的ViewGroup。在这个RelativeLayout的我有日志时onMeasure()被调用一些其他的看法。当我翻到另一页,onMeasure被称为为每个视图六次。我已经消除了一些TextViews,因为他们要求布局通行证文本发生变化时,...

我有一个包含在每个页面一RelativeLayout的一个发射状的侧面滚动定制的ViewGroup。在这个RelativeLayout的我有日志时onMeasure()被调用一些其他的看法。当我翻到另一页,onMeasure被称为为每个视图六次。我已经消除了一些TextViews,因为他们要求布局通行证文本发生变化时,但我找不到其他原因进行布局的要求。

I have a Launcher-like side-scrolling custom ViewGroup that contains a RelativeLayout in each "page". Within this RelativeLayout I have some other views that log when onMeasure() is called. When I flip to another page, onMeasure is called six times for each view. I have already eliminated some TextViews because they request layout passes when the text changes, but I cannot find the other causes for layout requests.

有谁知道一个把戏找原因了内部的ViewGroup布局的要求?

Does anybody know a trick to find cause for layout requests within a ViewGroup?

在一个相关的说明,没有任何人知道一个把戏,以确保TextViews不要哭布局要求的文本变更时?还有埋在源的一些提示(http://$c$csearch.google.com/$c$csearch/p?hl=en#uX1GffpyOZk/core/java/android/widget/TextView.java&q=package:android.git.kernel.org%20file:android/widget/TextView.java&sa=N&cd=1&ct=rc左右线5500),但我不能做到这一点。

On a related note, does anybody know a trick to make sure that TextViews do not cry for layout requests when the text changes? There are some hints buried in the sources (http://codesearch.google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/widget/TextView.java&q=package:android.git.kernel.org%20file:android/widget/TextView.java&sa=N&cd=1&ct=rc around line 5500), but I couldn't make it happen.

谢谢!

推荐答案

TextView中需要一个布局传递时,该文本的变化,你不能真正解决这个问题。

TextView needs a layout pass when the text changes, you can't really work around this.

阅读全文

相关推荐

最新文章