大家好我如何在refractored.controls.CircleImageView中添加click事件 我在axml中设置了
android:clickable="true"
我的代码
NavigationView navigationView = FindViewById<NavigationView>(Resource.Id.nav_view);
if (navigationView != null)
{
SetUpDrawerContent(navigationView);
var navEvnt = navigationView.FindViewById<CircleImageView>(Resource.Id.masterUser);
navEvnt.Click += (sender, e) =>
{
Intent inf = new Intent(navigationView.Context, typeof(MessageLayout));
StartActivity(inf);
};
}
但我总是收到System.NullReferenceException的错误:对象引用未设置为对象的实例。听起来好像找不到我的CircleImageView id