1.布局文件xml

<ZoomControls android:id=”@+id/zoomControls” android:paddingRight=”15px” android:layout_alignParentRight=”true”
            android:layout_width=”wrap_content” android:layout_height=”wrap_content” />

2.声明:

private ZoomControls mZoomControls;

3.调用:

mZoomControls = (ZoomControls) findViewById(R.id.zoomControls);
        mZoomControls.setIsZoomInEnabled(true);
        mZoomControls.setIsZoomOutEnabled(false);
        //放大
        mZoomControls.setOnZoomInClickListener(new OnClickListener() {
            public void onClick(View v) {
               //TO-DO                   mZoomControls.setIsZoomInEnabled(false);
                mZoomControls.setIsZoomOutEnabled(true);
            }
        });
        // 缩小
        mZoomControls.setOnZoomOutClickListener(new OnClickListener() {
            public void onClick(View v) {
                 //TO-DO                                   mZoomControls.setIsZoomInEnabled(true);
                mZoomControls.setIsZoomOutEnabled(false);
            }
        });