Comment modifier la taille d'une WebView?
Bonjours à tous,
lors d'une recherche dans ma WebView, le clavier redescend et une page est chargé:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| mSearch.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) {
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(mSearch.getWindowToken(), 0);
Log.e("Taille de la webview",wb_tablet.getHeight()+"");
if(url.containsKey(arg2)){
wb_tablet.loadUrl("javascript:"+url.get(arg2));
Log.e("log",url.get(arg2));
mSearch.setText("");
}
}
}); |
Fichier XML:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<WebView
android:id="@+id/wb_tablet"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:isScrollContainer="true">
</WebView>
</LinearLayout> |
Le clavier redescend mais la WebView reste toute petite, à peine un petit cadre!
Comment redonner sa bonne taille à la WebView (Ici "wb_tablet")?
Bien cordialement :)