您的目标是什么 API 级别?DragShadowBuilder
在 11 级以上可用。
我在 Mono for Android 4.2.6 上针对 API 级别 12(最低级别 Android 3.1)测试了您的代码,它编译没有问题并部署到模拟器。
您是否尝试过清理/重建解决方案?
您是否尝试过从头开始创建新项目并实施此类以查看问题是否与您现有的解决方案隔离?
还要检查你的 ACW 在 obj\debug\android\src\wordshuffle\android\shadowbuilders\ 文件夹中的样子。
我的看起来像这样
package androidapplication1;
public class TileShadow
extends android.view.View.DragShadowBuilder
implements
mono.android.IGCUserPeer
{
static final String __md_methods;
static {
__md_methods =
"n_onDrawShadow:(Landroid/graphics/Canvas;)V:GetOnDrawShadow_Landroid_graphics_Canvas_Handler\n" +
"";
mono.android.Runtime.register ("AndroidApplication1.TileShadow, AndroidApplication1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", TileShadow.class, __md_methods);
}
public TileShadow (android.view.View p0)
{
super (p0);
if (getClass () == TileShadow.class)
mono.android.TypeManager.Activate ("AndroidApplication1.TileShadow, AndroidApplication1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "Android.Views.View, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c4c4237547e4b6cd", this, new java.lang.Object[] { p0 });
}
public TileShadow ()
{
super ();
if (getClass () == TileShadow.class)
mono.android.TypeManager.Activate ("AndroidApplication1.TileShadow, AndroidApplication1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "", this, new java.lang.Object[] { });
}
public void onDrawShadow (android.graphics.Canvas p0)
{
n_onDrawShadow (p0);
}
private native void n_onDrawShadow (android.graphics.Canvas p0);
java.util.ArrayList refList;
public void monodroidAddReference (java.lang.Object obj)
{
if (refList == null)
refList = new java.util.ArrayList ();
refList.add (obj);
}
public void monodroidClearReferences ()
{
if (refList != null)
refList.clear ();
}
}