What does offsetLeftAndRight () do exactly?

What does offsetLeftAndRight () do exactly? The documentation says: “Offset this horizontal position of the view by the specified number of pixels” So, does this mean that if the left position of the view assumes 50 is called on it and offsetLeftAndRight (20) is called on it, then the view will move 20 pixels , and its left position will be (50-20), i.e. thirty?

Thanks in advance.

+8
android offset android-view
source share
1 answer

Both left and right positions will be increased by offset. Therefore, in your example, the left position will change by 50 + 20 = 70.

+7
source share

All Articles