How to restrict the WebView inside in android program -


I restrict webView limited inside some pixels I want to do that which is declared at the time of initialization webView insert = find VVBIID (RID layout); Webview web = new webview (this); Web.setBackgroundColor (Color.GRAY); Int lHeight = 200; Int lWidth = 200; (Include (view group)) .addView (Web, ElwoodD, L HEIGHT); Web.loadUrl ("http://www.google.com");

Edited:

Full screen is taken by that WebView , it is not inside 200px * 200px .

Edit:

  & lt; LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http: //schemas.android.com/tools" Android: layout_width = "wrap_content" Android: layout_height = Android: paddingBottom = "@ Dimen / activity_vertical_margin" Android: paddingLeft = "@ Dimen / activity_horizontal_margin" Android: paddingRight = "@ Dimen / activity_horizontal_margin" Android: paddingTop = "@ Dimen / activity_vertical_margin" tool: Reference = "MainActivity "Android: ID =" @ + id / layout "& gt; & Lt; / LinearLayout & gt;    

If you also add line, your code should work:

  web.setWebViewClient (new WebViewClient ());   

Otherwise your code will start browser (which is full screen). For example, if you click on the back, you should see your gray box.

Comments

Popular posts from this blog

php - How to filter values fetched from database on the basic of comma included? -

excel vba - How to delete Solver(SOLVER.XLAM) code -

c# - Add Image in a stackpanel based on textbox input -