Overlay on an Image in Android
I have an app, in which i used TouchImageView to include an image, and implement zooming using pinch zoom, panning, etc. It's working fine. Now i need to include some kind of an image, or a text written as an overlay on the TouchImageView image.
I have tried to draw using a canvas, but that draws on the background, rather than the TouchImageView. So how do i implement it, so that the image has a pointer or overlay on it, and it can be zoomed, panned, etc.
An开发者_运维问答y help will be appreciated.
Edit - I'm attaching my XML
<?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>
And in my code, I used it this way!
Panel v =(Panel)findViewById(R.id.panelView);
v.bringToFront();
Cheers,
Nithin
I would use relativelayout and let the overlay view always be on top.
overlayView.bringToFront();
will bring it to the front.
精彩评论