2010-07-31 77 views
0

我必須在webview中執行它的url加載視圖,並在Linearlayout中的兩個相對佈局我隱藏一個在webview中顯示url時,它有垂直和水平滾動,我現在面臨的問題在這裏是 只有水平滾動只,但我還需要查看它也垂直,問題在圖像垂直滾動

這裏佈局

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:layout_width="fill_parent" android:layout_height="wrap_content" 
       android:layout_marginTop="5dip" android:layout_marginBottom="5dip" 
       android:scrollbars="none"> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
        android:layout_width="fill_parent" android:layout_height="fill_parent" 
        android:id="@+id/jr_lb_view_preview"> 
     <ProgressBar android:id="@+id/jr_lb_content_iv_progress" 
        android:layout_centerInParent="true" android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:indeterminateDrawable="@drawable/pb" /> 
     <ImageView android:id="@+id/jr_lb_content_iv" 
        android:layout_centerInParent="true" android:layout_width="150dip" 
        android:layout_height="225dip" android:background="@drawable/border"/> 
    </RelativeLayout> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
        android:layout_width="wrap_content" android:layout_height="wrap_content" 
        android:id="@+id/jr_lb_wb_view" android:background="@drawable/border" 
        android:scrollX="1dip">    
     <WebView android:id="@+id/jr_lb_view_preview_switcher2" 
       android:layout_width="308dip" android:layout_height="305dip" 
       android:background="@drawable/border" android:scrollbars="vertical" 
       android:scrollbarAlwaysDrawVerticalTrack="true"/> 
    </RelativeLayout> 
</LinearLayout> 

活動代碼的XML代碼

public void onClick(View v) { 
    preview.setVisibility(View.GONE); 
    g.setSelection(gPosition); 
    webview = (WebView) findViewById(R.id.jr_lb_view_preview_switcher2); 
    webview.getSettings().setBuiltInZoomControls(true); 
    new Task_Item_Selected().execute(); 
    webview.loadUrl(product_img_large[gPosition]); 
    webview.setVisibility(WebView.VISIBLE); 
    preview2.setVisibility(View.VISIBLE); 
     // applyRotation(0, 0, 90); 

    } 

有人幫我解決這個問題, 提前感謝

回答

0

改變佈局的高度,「FILL_PARENT」或「MATCH_PRAENT」