Delpin Susai Raj Tuesday 8 August 2017

Create an Frame Layout in Xamarin Andorid

In this article, you will learn how to Create an Frame Layout in Xamarin Android app, using Visual Studio 2015.

Introduction

Xamarin is a platform to develop cross-platform and multi-platform apps (for example, Windows phone, Android, iOS).
In the Xamarin platform, the code sharing concept is used. In Xamarin Studio, Visual Studio is also available.

Prerequisites


  • Visual Studio 2015(or) Later.


The steps, given below are required to be followed in order to Create an Frame Layout 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. in the solution explorer is have the all files and source in your project.
Next Select Resource-->Layout-->double click to open main.axml page. you want select source to write the xaml code.
you want design choose the designer window you can design your app.



step:4

After open the main.axml file will open the main page designer. in this page which type you want you can design this page.

Next Delete the default Linear Layout.



step:5

In this step go to Main.axml page source. write the following Frame Layout code.

Main.axml



step:6

Now, go to the toolbox Window. In the toolbox Window, get all the types of the tools and controls.
You need to go to the toolbox Window. Now, scroll down and you will see all the tools and controls.

You need to drag and drop the ImageView.



step:7

Now,drag and drop the TextView.



step:8

In this step, add the Image from your local system.

Go to Solution Explorer-->Resource-->Drawable-->Right click-->Add-->Existing Item (Shift+Alt+A).



step:9

Now, you can choose the required image. Click Add.and edit imageView src property, you can choose added image.



step:10

Now, go to the properties Window. You need to edit the TextView properties Values.



step:11

In this step, go to the Main.axml page Source Panel.Check the Following code.

Main.axml



step:12

In this step, go to MainActivity.cs page. Write the code, mentioned below between OnCreate() Method.

MainActivity.cs

protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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



step:13

If you have Android Virtual device, run the app on it. Else, connect your Android phone and run the app in that.
Simply, connect your phone and go to Visual Studio.  The connected phone will show up in the Run menu (Ex:LENOVO A6020a40(Android 5.1-API 22)). Click the Run option.



output

After a few seconds, the app will start running on your phone.

You will see the Frame Layout is work Successfully.



Summary :So, this was the process of how to Create an Frame Layout in Xamarin Android app, using Visual Studio 2015.

1 comment:

  1. Xamarin Monkeys: Create An Frame Layout In Xamarin Andorid >>>>> Download Now

    >>>>> Download Full

    Xamarin Monkeys: Create An Frame Layout In Xamarin Andorid >>>>> Download LINK

    >>>>> Download Now

    Xamarin Monkeys: Create An Frame Layout In Xamarin Andorid >>>>> Download Full

    >>>>> Download LINK f2

    ReplyDelete