I am having some problems with setting a view's height:
It seems that the number that I set on the LayoutParams does not correspond to the x and y coordinates on the screen.
For example: when I set a View's height to 10 and then set another view's y coordinates to the first View's coordinates + 10, it positions the view with an offset on the y axis.
But when I use View.getHeight() and set another views coordinates to the first view's coordinates + v.getHeight() it has no offset.
Are the layoutparams Height density-dependent?
EDIT
This is what I do:
view1.getLayoutParams().height = Height + MainActivity.pixels;
if (MainActivity.connections [i] != 0){
int SiblingY = (int) view1.getY() + Height + MainActivity.pixels;
view2.setY(SiblingY);
When I do this, view2's top does not allign perfectly with view1's bottom.
But if I do:
int SiblingY = view1.getX + view1.getHeight();
vMoved.setY(SiblingY);
It works perfectly, the problem is that the latter needs to be done after the Height changes on the screen, so I have to execute that on another event.