问题描述:
布局:

<ScrollView >
       <LinearLayout  >

</LinearLayout>
       <LinearLayout  >

</LinearLayout>
      <LinearLayout  >

</LinearLayout>

</LinearLayout>
</ScrollView>

当 View.GONE 时,child2会自动移到最顶部,并且全屏显示出来,但是child3还在,其实已不在了,只是没有刷新过来。

尝试1:
container.requestLayout();
container.postInvalidate();

  不行。

尝试2:
child3.clearAnimation();

不行。因为这里面用了一个控件,显示是有一个动画的,会不会是这个引起的。


尝试3:

scroll.postInvalidate();

  成功。这行代码,加到原来setVisibility(View.GONE); 下面一行就可以了。

  

相关文章:

  • 2021-10-29
  • 2021-07-02
  • 2022-12-23
  • 2022-01-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2021-06-28
  • 2022-12-23
  • 2021-11-06
  • 2021-04-07
相关资源
相似解决方案