开发者

Zoom controls on an image placed in image view?

      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_cont开发者_开发百科ent"
                  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>

Please help and give suggestion.its really important... have image that i want to zoom. i have placed the image in an image view and was trying the java code given above but i having error regarding iview.getzoomcontrols(); that this function in undefined for image view...please help me in correction the code


it is because the method getZoomControls is defined for the ZoomButtonsController class.

http://developer.android.com/reference/android/widget/ZoomButtonsController.html

though, i don't know any tutorial. Good luck !

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜