user3508182
user3508182

Reputation: 457

what is plus padding and minus padding?

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?

Upvotes: 2

Views: 895

Answers (2)

Christian Cederquist
Christian Cederquist

Reputation: 513

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

Upvotes: 2

Sunny Garg
Sunny Garg

Reputation: 1073

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.

Upvotes: 2

Related Questions