E
E
En1q0d2016-03-12 07:47:35
Android
En1q0d, 2016-03-12 07:47:35

How to resize ImageView programmatically using PercentLibrary?

How to resize an ImageView through code if you use PercentLibrary? You also want to change the percentage.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Dorofeev, 2016-03-12
@En1q0d

Basically, just like the usual one View:

PercentRelativeLayout.LayoutParams params = (PercentRelativeLayout.LayoutParams)
                myImageView.getLayoutParams();
 PercentLayoutHelper.PercentLayoutInfo info = params.getPercentLayoutInfo();
 info.heightPercent = 0.50f;
 myImageView.requestLayout();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question