なぜ私は持っているの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 を追加するにはどうすればよいですか?
Resource.designer.cs :
public partial class Layout
{
public const int Main = 2130903041;
//other
}