我坚持为 Android 编写 C# Mono,相当于以下 Java 事件处理程序代码:
public class Player extends ListActivity
{
private ImageView list;//basically this is a buttona
private void SetupButtonListeners()
{
list.setOnClickListener(new OnClickListener()
{
public void onClick(View v)
{
//do stuff
}
});
}
/*
more stuff here
*/
}
API 参考:http ://androidapi.xamarin.com/?link=T%3aAndroid.Widget.Button