简体   繁体   English

在android中单击按钮后如何重绘linearlayout?

[英]how to redraw linearlayout after clicking on button in android?

我有一个linearlayout,当我单击一个按钮时,它会动态填充texviews,但是linearlayoutout的内容没有出现,我该如何重画它?

To force a view to draw, call invalidate(). 要强制绘制视图,请调用invalidate()。 (see: http://developer.android.com/reference/android/view/View.html ) (请参阅: http : //developer.android.com/reference/android/view/View.html

If the textView is changes inside the on click listen event on the button then there is no need to call the invalidate. 如果textView在按钮上的on click监听事件内发生更改,则无需调用invalidate。 I suggest you to post the code so that it will give a more clear picture. 我建议您发布代码,以便提供更清晰的图片。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM