2013-04-06 46 views

回答

26

use this jar in your application

1,創建一個新的佈局(R.layout.zoomableview)爲我想申請變焦功能視圖。

2.將其放置在ZoomView中。

3.然後將ZoomView放到要顯示可縮放視圖的主容器上。

private ZoomView zoomView; 

@Override 
protected void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
setContentView(R.layout.activity_zoomable); 

View v = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.zoomableview, null, false); 
v.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); 

zoomView = new ZoomView(this); 
zoomView.addView(v); 

main_container = (LinearLayout) findViewById(R.id.main_container); 
main_container.addView(zoomView);   } 
+0

@BlackTiger其佈局,我們可以在充氣聲明佈局....... – NagarjunaReddy 2014-03-18 11:58:17

+0

@NVR哪個佈局我們可以在膨脹佈局中聲明....... – NagarjunaReddy 2014-03-18 11:58:40

+0

太棒了!它的工作:) – 2014-12-08 06:48:56