2

I tried to change RelativeLayout's height programmatically, that is using Java. I have the following code:

RelativeLayout rl = (RelativeLayout) findViewById(R.id.center);
rl.getLayoutParams().height = 100;

I'm bothered of the unit of height.

Is it px, dp or some other unit?

If it is px, is there a way I can use dp since dp is more advisable than px because it's actually dynamic?

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.