Hello Everyone,
If you are an
android developer then you must be aware of it’s UI designing
part. It’s nothing but to design the layouts (i.e XML files). It’s
the part which I used to skip all the time. I never took this
seriously until last couple of days. You must be thinking what the
hell happened with me ? Well, I was assigned an android project last
week. I have to work upon this project from scratch. In my earlier
projects I was not bothered about this designing and all things so I
could concentrate only on the logical part. Unfortunately, it is not
the case this time.
Since I was left
with no other choice but to learn the UI design. So finally, I
started learning it. So I thought sharing my learnings with
you guys will be a good idea. I am thankful to Nishant(Sir) who helped me to learn this XML things
with an ease. He is a champ, and I just got lucky to work with him.
Let’s start from
one of the most basic concepts, such as :
1. What’s the
difference between margin and padding
?
Padding
is for inside/within components. Eg. TextView
, Button,
EditText
etc.Eg. space between the Text and Border
Margin
is to be applied for the on-outside of the components.Eg. space between left edge of the screen and border of your component
Also,
Margin is that space between the edge of an element's box and the edge of the complete box, such as the margin of a letter
It means, if we need all the four (left, right, top, and bottom) margins for any view. Then we don't need to specify all the four margins. We can use just "margin" which means margins from all the corners.
2. What is the
difference between Linear, Relative and Frame layouts ??
LinearLayout
means you can align views one by one (vertically/ horizontally).RelativeLayout
means based on relation of views from its parents and other views.FrameLayout
to load child one above another, like cards inside a frame, we can
place one above another or anywhere inside the frame.
So before picking up any layout for your design, observe the screen and you will get an idea to select the suitable layout for your screen.
One last thing, by default, the text within any Button is set to upper-case. If you wanna change is to lower case. All you have to do is to include this line anywhere into your Button tag.
<Button android:textAllCaps="false"
/>
Will share some more in my coming blogs. If you wanna more clarity about anything mentioned in my blog, feel free to mail me or comment below.
Take Care and have a good day !!
Take Care and have a good day !!
No comments:
Post a Comment