Starting with Xamarin

Asked

Viewed 80 times

1

I got interested in Xamarin and decided to test the short time, the problem is that all the tutorials I saw have the option "Portable", and in visual studio 2017 does not have, even for android as for cross Plataform (I have no mac).

When I open a "Blank App (Android)" it opens different from other tutorials, for example:

My code:

    namespace App14
{
    [Activity(Label = "App14", MainLauncher = true)]
    public class MainActivity : Activity
    {
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
        }
    }
}

    namespace App14
{
    [Activity(Label = "App14", 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);

            Button button = FindViewButtonId<Button>(Resource.Id.MyButton);

            Button.Click +- delegate { button.Text = string.Format("{0} clicks!", count++ ")}

        }
    }
}

And with that I get lost, I did not find any updated and explanatory tutorial

1 answer

0

The path to creating PCL projects is somewhat different in the latest versions of visual studio. Go to File > New Project > Cross-Platform > Cross-Platform App (Xamarin.Forms). In the code sharing strategy or Code Sharing Strategy select ". NET Standard". Done this the VS will create a PCL project.

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.