为什么我有mainLayout==null
?
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.Main);
LinearLayout mainLayout = FindViewById<LinearLayout> (Resource.Layout.Main);//return null
mainLayout.Touch+=(s,e)=>
{
//something
}
}
如何获取 MainLayout 或如何添加事件处理程序 Touch?
资源设计器.cs:
public partial class Layout
{
public const int Main = 2130903041;
//other
}