开发者

Button for a webview android

i was wondering is it possible to add a button below a webview such that on clicking it, it should flip and give another webpage and so on, maybe a back button to return to the previous webpage, Can we make such changes in the layout> if so how? Coz whenever I wrote TabHost program for webview, upon selecting the tab,it would fill the entire page hiding the tabs,

I want to开发者_高级运维 create a combination of ViewFlipper, WebView and Button


Make a layout with a flipper. In your code, try

WebView myWebView1 = ...;
WebView myWebView2 = ...;
Flipper myFlipper = (Flipper)(findViewById(R.id_myflipper);
myFlipper.addView(myWevView1);
myFlipper.addView(myWebView2)

when you press your button, change the current view in the flipper by

myFlipper.setDisplayedChild(flipperID);

Where flipperID is the index of the view you want to show.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜