2

I have a very small question which occurred while reading wrap content and parent content that what is plus padding and minus padding?

According to me i think plus padding means increase distance (from margin) x-axis and decrease x-axis . is it so?

user3508182
  • 457
  • 1
  • 4
  • 13

2 Answers2

2

Yes you are right.

For example ->

android:paddingLeft = "4dp" means it will take shift the text to right by 4dp.

android:paddingLeft = "-4dp" means it will take shift the text to left by 4dp.

Sunny Garg
  • 1,073
  • 1
  • 6
  • 13
2

Related answer: Difference between a View's Padding and Margin

Padding can be seen as an internal margin, or a margin applied to elements inside the padded element, as seen in f.ex. a TextView, where a padding would shift the text away from the border, or make the TextView larger to accomodate the padding. In a layout, using padding will shift all the content away from the padded edges. Using negative padding will shift the content towards the edges, so using android:paddingLeft = "-5px" would shift the content to the left

Community
  • 1
  • 1