Introduction
Xamarin is a platform to develop cross-platform and multi-platform apps (for example, Windows phone, Android, iOS). In Xamarin platform, the code sharing concept is used. In Xamarin Studio, Visual Studio is also available. RatingBar is used to rate the app performance and quality based on user reviews to provide ratings.
Prerequisites
- Visual Studio 2015 Update 3.
The steps, given below, are required to be followed in order to Use the RatingBar in the Xamarin Android app, using Visual Studio 2015.
Step 1
Click File--> select New--> select Project. The project needs to be clicked after opening all the types of projects in Visual Studio or click (Ctrl+Shift+N).

Step 2
After opening the New Project, select Installed-->Templates-->Visual C#-->Android-->choose the Blank app (Android).
Now, give your Android app a name (Ex:sample) and give the path of your project. Afterwards, click OK.

Step 3
Next, go to the Solution Explorer and select Resource-->Layout-->double click to open main.axml page.

Step 4
After opening, the main.axml file will open the main page designer. In this page, select the type which you want to design this page.

Next, delete the default "hello world" button from source panel coding. And, delete the C# button action code by going to the MainActivity.cs page.
Step 5
Now, go to the toolbox Window. In the toolbox Window, scroll down and you will see all the tools and controls.
You need to drag and drop the RatingBar.

Step 6
Now, go to the properties window. You need to edit the RatingBar Id Value(EX: android:id="@+id/ratingbar").

Step 7
And also, edit the Ratingbar numStars value and stepSize value(E: android:numStars="5" android:stepSize="1.0").

Step 8
In this step, go to the Main.axml page Source Panel. Note, the RatingBar Id value.
Main.axml







Join the conversation! Your thoughts help the community grow.