TOOLBAR – Quick Tutorial (Xamarin Android) (Code)

1  comments

Toolbar is a significant part of any Android UI. A user expects it to be there and be useful. While we’re not gonna discuss how to make it useful, you’re at least going to learn how to make it a part of your app’s UI in this tutorial.

You will learn how to create a simple plain toolbar using an AppCompat support library. Then you will find out how to create a toolbar menu.

 

This post contains all the code that’s been written in this YouTube video.

 

 

You can also check out this GitHub repository: https://github.com/ResoCoder/ToolbarXamarinAndroid

MainActivity.cs

 

Main.axml

 

toolbar_menu.axml

 

styles.xml

 

AndroidManifest.xml

 

About the author 

Matt Rešetár

Matt is an app developer with a knack for teaching others. Working as a Flutter freelancer and most importantly developer educator, he doesn't have a lot of free time 😅 Yet he still manages to squeeze in tough workouts 💪 and guitar 🎸

You may also like

Flutter Custom & Staggered Page Transition Animation Tutorial

Flutter Firebase & DDD Course [5] – Sign-In Form Logic

  • Hi, great videos – appreciate your efforts.
    Been learning your Android programming for 2 days now.
    I managed to get the calculator app to work yesterday.
    Today I tried to add the Toolbar app to that project and I am having issues – obviously I don’t know enough.
    3 errors:
    Severity Code Description Project File Line Suppression State
    Error 8: error: Error: No resource found that matches the given name (at ‘icon’ with value ‘@drawable/icon’). Calculator C:\Users\andre\source\repos\Calculator\Calculator\obj\Debug\android\manifest\AndroidManifest.xml

    Error 7: error: Error: No resource found that matches the given name (at ‘theme’ with value ‘@style/AppTheme’). Calculator C:\Users\andre\source\repos\Calculator\Calculator\obj\Debug\android\manifest\AndroidManifest.xml

    Error 7: error: Error: No resource found that matches the given name (at ‘icon’ with value ‘@drawable/icon’). Calculator C:\Users\andre\source\repos\Calculator\Calculator\obj\Debug\android\manifest\AndroidManifest.xml

    let me know if you have time to review this.

    I had a few questions –

    1. using Android:widgets;
    vs using Android.Support.V7.Widget;

    2. had issues with TextView working since adding the new reference – same with FindViewById
    changed it to: calculatorText = FindViewById(Resource.Id.calculator_text_view);

    look forward to hearing from you.

    regards,
    Andrei

    Reply

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
    >