0
私はTouchImageViewを使用して画像を組み込み、ピンチズーム、パンなどを使ってズームを実装するアプリを持っています。うまくいきます。これで、TouchImageViewイメージに何らかのイメージやオーバーレイとして書かれたテキストを含める必要があります。Androidの画像上にオーバーレイする
私はキャンバスを使用して描画しようとしましたが、TouchImageViewではなく背景に描画されます。どのように私はそれを実装するので、画像にポインタやオーバーレイがあり、ズームやパンなどができます。
助けてください。
編集 - 私は
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/rel"
><com.reva.restauranthome.Panel android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/panelView">
</com.reva.restauranthome.Panel>
<ZoomControls android:id="@+id/zoomControls1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true"></ZoomControls></RelativeLayout>
私のXMLを取り付けることだし、私のコードでは、私はそれをこのように使用!
Panel v =(Panel)findViewById(R.id.panelView);
v.bringToFront();
乾杯、
ニシン
ありがとう、私は同じ考えがありました。少し助けが必要です。私はView(オーバーレイのための)を拡張するカスタムクラスを持っています。そして、私はそれをonCreate()メソッドでどのようにリンクしますか?私はこのように試しました! View v =(View)findViewById(R.id.panelView)、しかしvはNULLを返します – nithinreddy
xmlとコードを提供できますか?カスタムレイアウトはどのレイアウトですか? –
読みやすくするために、質問にコードを含めました。 – nithinreddy