Close
Topic : User Interface » Introduction to Layout:



Layout:

When we create our app interface, we use some special view that acts as a container. These special views control how other views are placed on the smartphone screen. Android provides a collection of Layout Managers and each of them implements a different strategy to hold, manage and place its children.

If You've worked with HTML elements, then layouts should feel familiar to you. The Purpose of a Layout is to indicate the location and size of each of its child elements. We can Declare Layout in two ways:



Layout : infobrother

  • » Using XML: We can Use XML file to describe how our User interface looks like. We define the elements such as views, and layouts that appear in the user Interface.
    » At Runtime: We can Code to describe the views and Layout that appear in the user interface. We can manipulate their properties programmatically setting their attributes.



In Android, Layouts can be Nested, so we can use different Layouts for different areas of our Interface. However, please be aware that it is not advisable to create too complex layouts because this can affect the overall app performance.



XML-Based Layouts:

In Android, an XML-based Layouts is a file that defines the Container to manages controls, Images, text and other Layouts. Android treats the Layout files as resources. If you are using Visual studio for your development, It creates a default XML layout file Main.axml in Layout folder. XML-Based Layouts are very helpful if we know the User Interface components at the time of compiling. If Run-time UI components are needed, those can be added using the XML code.

  • XML-based layout have the following Advantages.
    » XML is very easy and Widely-used Mark-up language.
    » XML Helps to Provide separation of the User interface from the code logic.
    » XML Output is easy to generate than writing direct code.
    » XML Make easy to have drag&drop User Interface tools to generate interfaces for Apps.



Layouts in Android:

Android Provides the Following standard Layouts that can be used in our Android Application.


Xamarin- Layout : infobrother
















I Tried my Best to Provide you complete Information regarding this topic in very easy and conceptual way. but still if you have any Problem to understand this topic, or do you have any Questions, Feel Free to Ask Question. i'll do my best to Provide you what you need.

Sardar Omar.
InfoBrother





WRITE FOR INFOBROTHER

Advertising






Advertisement