I develop application which has webview and imageview(as toogle button), if button clicked then webview will be closed, if button clicked again, then webview will be opened. Is it possible in android? see the circle red with up arrow which can hide and unhide above banner
My reference like this application
-
You can set webView.setVisibility(View.GONE); and toggle it on button click..– Virag BrahmeNov 29, 2013 at 9:42
-
1you developed the whole thing and you have problem change the visibility of a View?– BlackbeltNov 29, 2013 at 9:43
5 Answers
for hide the webview
mWebView.setVisibility(View.GONE);
for show the webview
mWebView.setVisibility(View.VISIBLE);
Just take all of your view which you want to hide in one Linearlayout
having orientation set to vertical and visiblity to visible and gone as below.
webView.setVisiblity(View.GONE);
and
webView.setVisiblity(View.Visible);
where webview is initialized by you xml's Webview.
I hope this works for you.
Thanks
you use setvisibility() method are follow...
if hide webview
webview.setvisibility(view.GONE);
if visible webview then
webview.setvisibility(view.visible);
that's solve your problem
You can use setVisibility()
method to achieve that.. setVisibility(View.VISIBLE)
to make the webview visible else setVisibility(View.INVISIBLE)
or setVisibility(View.GONE)
to make it vanish
-
okay thanks, my fault is using VIEW.INVISIBLE, now is working – Agoeng Lauw Nov 29, 2013 at 9:53