2011-03-31 164 views
0
 public class map extends Activity { 

    public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 

    ImageView iview = (ImageView)findViewById(R.id.iv1); 
    FrameLayout mContentView = (FrameLayout)  
     getWindow().getDecorView().findViewById(R.id.FrameLayout01); 

    final View zoom = iview.getZoomControls(); 
    mContentView.addView(zoom, ZOOM_PARAMS); 
    zoom.setVisibility(View.VISIBLE); 

      } } 


    <FrameLayout 
     android:id="@+id/FrameLayout01" 
    android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
      xmlns:android="http://schemas.android.com/apk/res/android"> 


      <ImageView android:id="@+id/iv1" android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
        android:background="@drawable/delhi2"></ImageView> 

        <ZoomControls android:layout_height="wrap_content" android:id="@+id/ZoomControls01" 
         android:layout_width="wrap_content" android:layout_gravity="right"> 
        </ZoomControls> 
         </FrameLayout> 

請幫助,並給出建議。它真的很重要... 有圖像,我想放大。我已經把圖像放在圖像視圖中,並嘗試上面給出的Java代碼,但我有關於iview.getzoomcontrols()的錯誤;這個函數在undefined中用於圖像視圖...請幫我修正代碼縮放放置在圖像視圖中的圖像的控件?

+0

可以請你解釋/詳細說明你的問題... – olamotte 2011-03-31 13:26:28

+0

我有圖像,我想放大。我已經把圖像放在圖像視圖中,並嘗試上面給出的Java代碼,但我有關於iview.getzoomcontrols()的錯誤;這個函數在undefined中用於圖像視圖...請幫我修改代碼 – sarva 2011-03-31 13:29:38

回答