F
F
falstaf2011-06-07 08:35:14
Android
falstaf, 2011-06-07 08:35:14

Android. Vertical padding in LinearLayout?

There is a LinearLayout (vertical), controls are programmatically placed in it. A vertical gap appears between these controls. Setting android:verticalSpacing to zero in the layout did not give any results.
What can be done so that the controls placed in the LinearLayout are located close and do not have this gap?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Slyusar, 2011-06-09
@slesar

It often happens that layouts in static are very different from those created on the fly. Try to shove the controls into separate XML and insert them through the inflater. Maybe additionally wrap it in a LinearLayout or RelativeLayout.

L
lavel, 2011-06-07
@lavel

Margin and Padding (top or bottom) are also missing? In the layout and in the components themselves? You can try to force them to be set to 0.

S
stepango, 2011-06-18
@stepango

It could be the controls themselves. Standard styles, if you use them, may contain indentation. There may also be no padding, but due to the fact that the background is drawn with padding, this effect may be present.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question