priyanaral
Lurker
Hello everyone,
I am new to android developer. Now i am doing webview gallery
in this gallery i load some images and i set loyout for mWebView.setLayoutParams(new Gallery.LayoutParams(70,85)); this 70 and 85 is height and width for webview but when the images are webview.loadurl that time some big and some small images are load... so problem is images are display more than width size and some lower than width then i won't set dynamically set height and width. It's height and width depend on whaterver images are comes for url ...see the below code then u can understand more detail .........
public View getView(int position, View convertView, ViewGroup parent) {
WebView mWebView = new WebView(mContext);
mWebView.loadUrl(it2[position]);
mWebView.setWebViewClient(new WebViewClient());
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setLayoutParams(new Gallery.LayoutParams(70,85));
WebSettings webSettings = mWebView.getSettings();
mWebView.setBackgroundColor(0);
mWebView.setInitialScale(100);
mWebView.setFocusable(false);
mWebView.setClickable(false);
mWebView.setWebViewClient(new HelloWebViewClient());
return mWebView;
}
}
I am new to android developer. Now i am doing webview gallery
in this gallery i load some images and i set loyout for mWebView.setLayoutParams(new Gallery.LayoutParams(70,85)); this 70 and 85 is height and width for webview but when the images are webview.loadurl that time some big and some small images are load... so problem is images are display more than width size and some lower than width then i won't set dynamically set height and width. It's height and width depend on whaterver images are comes for url ...see the below code then u can understand more detail .........
public View getView(int position, View convertView, ViewGroup parent) {
WebView mWebView = new WebView(mContext);
mWebView.loadUrl(it2[position]);
mWebView.setWebViewClient(new WebViewClient());
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setLayoutParams(new Gallery.LayoutParams(70,85));
WebSettings webSettings = mWebView.getSettings();
mWebView.setBackgroundColor(0);
mWebView.setInitialScale(100);
mWebView.setFocusable(false);
mWebView.setClickable(false);
mWebView.setWebViewClient(new HelloWebViewClient());
return mWebView;
}
}