HƯỚNG DẪN XAMARIN

Trong nội dung bài viết này

Watch this Clip and follow along to create your first Mobile phầm mềm with Xamarin.Forms.

Bạn đang xem: Hướng dẫn xamarin


Step-by-step instructions for Windows

Download the sample

Follow these steps along with the video above:

Wait until the NuGet packages are restored (a "Restore completed" message will appear in the status bar).

New Visual Studio 2019 installations won"t have sầu an Android emulator configured. Clichồng the dropdown arrow on the Debug button & choose Create Android Emulator to lớn launch the emulator creation screen:

*

Creating an emulator will return you lớn the Device Manager window. Click the Start button lớn launch the new emulator:

*

Visual Studio 2019 should now show the name of the new emulator on the Debug button:

*

Click the Debug button lớn build và deploy the application khổng lồ the Android emulator:

*

Customize the application

The application can be customized khổng lồ add interactive functionality. Persize the following steps to add user interaction to lớn the application:

Edit MainPage.xaml, adding this XAML before the kết thúc of the :

Edit MainPage.xaml.cs, adding this code lớn the end of the class:

int count = 0;void Button_Clicked(object sender, System.EventArgs e) count++; ((Button)sender).Text = $"You clicked count times.";Debug the tiện ích on Android:

*


Note

The sample application includes the additional interactive functionality that is not covered in the video.

Xem thêm: CáC ĐiểM Đăng Ký Biển Số Xe Tphcm Tiếp Nhận Thủ Tục Đăng Ký Xe


Build an iOS app in Visual Studio 2019

It"s possible to build và debug the iOS tiện ích from Visual Studio with a networked Mac computer. Refer to the thiết lập instructions for more information.

This Clip covers the process of building & testing an iOS tiện ích using Visual Studio 2019 on Windows:


Step-by-step instructions for Windows

Download the sample

Follow these steps along with the đoạn Clip above:

Wait until the NuGet packages are restored (a "Restore completed" message will appear in the status bar).

Launch Android emulator by pressing the debug button (or the Debug > Start Debugging thực đơn item).

Edit MainPage.xaml, adding this XAML before the over of the :

Edit MainPage.xaml.cs, adding this code to lớn the end of the class:

int count = 0;void Button_Clicked(object sender, System.EventArgs e) count++; ((Button)sender).Text = $"You clicked count times.";