1

I am new to android.. I have a slider in my xml. For the particular value of the slider I want an Image to appear and later disappear.. I heard that View Stub can do the trick.. But not exactly getting the solution.. Can any one please help me..

Thanks, Keerthiraj

4

1 回答 1

1

ViewStub当您有一个隐藏但可能稍后显示的“重”视图时使用。ViewStub是一个轻量级视图,当它可见时,它会在运行时膨胀真实视图。

所以ViewStub不能解决你的问题。我认为对您来说最好的解决方案是设置ImageView可见性:

imageView1.setVisibility(View.GONE);
imageView2.setVisibility(View.VISIBLE);
于 2011-08-19T05:12:17.317 回答