Controls showing in designer but not in emulator

后端 未结 3 1295
野的像风
野的像风 2021-01-15 23:31

This is my first Xamarin app. I have my environment set up in Visual Studio, and have a template project which I can run in the Android emulator.

Having dragged and

3条回答
  •  北恋
    北恋 (楼主)
    2021-01-16 00:21

    Just downloaded your code and ran it. Uncommenting SetContentView (Resource.Layout.Main); it worked to me.

    [Activity(Label = "Tgo.AndroidApp", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : Activity
    {
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
    
            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);
        }
    }
    

    Here a nice guide to get you started with Xamarin Android.

提交回复
热议问题