0
例如like,Android:可以将活动加载为视图吗?
查看v = MapActivity.class;
下面的工作作为一项活动,但它不工作时,我尝试用适配器生成视图。
setContentView(R.layout.zoommain);
mZoomControl = new DynamicZoomControl();
mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.image800x600);
mZoomListener = new LongPressZoomListener(getApplicationContext());
mZoomListener.setZoomControl(mZoomControl);
//not working... loading custom view
mZoomView = (ImageZoomView)findViewById(R.id.zoomview);
//mZoomView = (ImageZoomView)context.getResources().findViewById(R.id.zoomview);
//context.getResources()
mZoomView.setZoomState(mZoomControl.getZoomState());
mZoomView.setImage(mBitmap);
mZoomView.setOnTouchListener(mZoomListener);
mZoomControl.setAspectQuotient(mZoomView.getAspectQuotient());
resetZoomState();
非常感谢。这是我需要的解释。 – 2011-04-26 13:26:53