Posts

Showing posts with the label margin vs padding Attributes

Margin vs. Padding Attributes in android

Image
There is always a confusion between the  padding  and  margin  attribute when you just start designing User interfaces. Be it web development or Android development, margin and padding is standard parameters to position and style User interface elements. Both provides extra space/gap inside or outside the container. Then what's the exact difference? Let's get it cleared. In simple words, margin means to push outside, whereas padding means to push inside. Now, lets understand what happens when we use these attributes for a  View  in Android. To more info visit Our Blog android course Tutorials  Margin and Padding with a View Let's see how we can use these attributes with a View in android and how it affects the View's position and styling. Margin → android:layout_margin When we say push outside, the view i.e the rectangle pushes its surrounding contents from itself by the dimension specified in the margin attribute. Here, the surrounding contents can b...