re-setting a TextView height programmatically

You should change it via LayoutParams:

LayoutParams params = (LayoutParams) textView.getLayoutParams();
params.height = 70;
textView.setLayoutParams(params);

EDIT

You should not use sizes in pixels in you code, use dimensions for this:

dimens.xml:

<dimen name="text_view_height">50dp</dimen>

In code:

params.height = getResources().getDimensionPixelSize(R.dimen.text_view_height);

Leave a Comment