I have here a WebView
that has height ( height ) of 0dp
defined in the activity XML.
How can I change the height to 300dp
programatically?
I have here a WebView
that has height ( height ) of 0dp
defined in the activity XML.
How can I change the height to 300dp
programatically?
After a little research I discovered the solution to my problem
mWebView=(WebView) findViewById(R.id.webView);
mWebView.setLayoutParams(new LinearLayout.LayoutParams(350,350));
There is another way that it is for RelativeLayout
round WebView
and then put in java:
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) someLayout.getLayoutParams();
params.height = 130;
someLayout.setLayoutParams(params);