これは私の最初の質問です!ズーム可能なアクティビティ (MainActivity) とビュー (PanZoomView) があります。レイアウトは
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.example.canvastest.PanZoomView
android:id="@+id/zoomview"
android:layout_width="300dp"
android:layout_height="300dp" />
<TextView
android:id="@+id/tv_mPosX"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<TextView
android:id="@+id/tv_mPosY"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</LinearLayout>
ビューで計算されるズーム倍率 (mScaleFactor) に従って tv_mPosX/Y 文字列を設定したい:
public class PanZoomView extends View {
protected Drawable mSampleImage;
protected Context mContext;
protected float mPosX;
protected float mPosY;
//
public float mScaleFactor = 1.f;
...
どこで/どのようにこれを処理できますか?
みんなのおかげで、リカルド