我有一個LinearLayout
設置,其中有一個圖像。如何允許用戶在LinearLayout中拖放圖像
我的XML佈局:
<LinearLayout
android:id="@+id/llColorSpect"
android:layout_width="match_parent"
android:layout_height="@dimen/color_scheme_height"
android:orientation="vertical"
android:background="@drawable/colorspect"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginBottom="@dimen/seek_bar_margin"
android:layout_below="@+id/tvBGColor" >
<RelativeLayout
android:id="@+id/rlColorSpect"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/ivSquare"
android:layout_width="@dimen/title_text_pad"
android:layout_height="@dimen/title_text_pad"
android:layout_alignParentBottom="true"
android:scaleType="fitXY"
android:src="@drawable/esquare" />
</RelativeLayout>
</LinearLayout>
它顯示與在其內部的方形箱(底部默認左)一個色譜(佈局背景)作爲顯示在下面:
- 我該如何允許用戶在佈局ONLY內拖放小方形圖像 ,並檢索X和Y值?
- 每當用戶在佈局內按下時,廣場將移動到 ,這些佈局將在佈局內協調。我怎樣才能做到這一點?
- 我想要使用這些X和Y值來獲得HEX/RGB值。 我將如何能夠完成它?
如果有人可以幫助我或兩個人,我真的很感激。
謝謝你的迴應。我實際上在Android中使用它:/ – Si8