2011-07-27 64 views
0

我有一個應用程序,其中我使用TouchImageView包括圖像,並實現使用縮放,平移等縮放。它工作正常。現在我需要在TouchImageView圖像中添加某種圖像或覆蓋文字。在Android上的圖像覆蓋

我試圖畫一個畫布,但是繪製在背景上,而不是TouchImageView。那麼我如何實現它,使圖像上有指針或覆蓋層,並且可以縮放,平移等。

任何幫助將不勝感激。

編輯 - 我附上我的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> 

而且在我的代碼,我用這種方式!

Panel v =(Panel)findViewById(R.id.panelView); 
      v.bringToFront(); 

乾杯,

尼西

回答

0

我會使用的RelativeLayout,讓重疊視圖始終在最前面。

overlayView.bringToFront(); 

將把它帶到前面。

+0

謝謝,我有同樣的想法。需要一點幫助。我有一個自定義的類,它擴展了View(用於疊加層)。我如何鏈接onCreate()方法。我試過這種方式!查看v =(查看)findViewById(R.id.panelView),但v返回空值 – nithinreddy

+0

您可以提供您的xml和您的代碼嗎?您的自定義視圖是哪種佈局? –

+0

爲了便於閱讀,我在代碼中加入了代碼。 – nithinreddy