Thursday 27 August 2015

Design of Android Studio- xml file

Android studio provide us two different ways of using xml file. The ways are shown in bottom left side of the window and they are Design and Text. Design window is the window in which you can drag the button, texts, checkboxes and all the stuffs directly into the layout.
The figure shown above is the Design view. Here we can place widgets directly by dragging them from palette into the layout screen
The other way is Text.
If you not able to screen in this layout then there is one toggle button written vertically in the right most side i.e. preview. Toggle that button to add or delete the Preview images of device.
In this file, you can add widgets by just writing there xml code.
The best thing about this feature provided by android studio is that. When you use method 1 i.e. Design view and when you drag a widget the code of the widget is directly created in the text view. So beginners can analyze the code of different buttons by using this method.
Other two windows in Design mode are component tree and Properties
Suppose for a particular project you have used very small texts or some overlapping widgets then it may be difficult for you to select a particular widget. For this thing you can just click on the widget in the tree and the widget from the layout will be selected.
Properties are the different options provided for the selected widget or layout. Clicking on empty area on screen will select the layout. How to use different properties will be discussed in later tutorials.

No comments:

Post a Comment