我想在圖片上即可丟棄的形象和我在這View
由ImageView
與v.name
鍵入鑄造代碼「回落」這種觀點將顯示在名爲「DropTarget的」爲背景,但不能happend其他ImageView
,plzz告訴我一個辦法。我的代碼是在這裏。:如何通過imageview將圖像背景設置爲imageView View?
case DragEvent.ACTION_DROP:
//handle the dragged view being dropped over a target view
View view = (View) event.getLocalState();
//stop displaying the view where it was before it was dragged
view.setVisibility(View.INVISIBLE);
//view dragged item is being dropped on
ImageView dropTarget = (ImageView) v;
//view being dragged and dropped
ImageView dropped = (ImageView) view;
//it give me error in this line
**dropTarget.setBackgroundResource(dropped);**
什麼是具體錯誤? –
錯誤是:類型View中的方法setBackgroundResource(int)不適用於參數(ImageView) –