In my program I am trying to add both group header and Child view as Grid view in Expandable listview
in android.
Asked
Active
Viewed 113 times
0

Paolo Forgia
- 6,572
- 8
- 46
- 58

Sivakumar
- 108
- 11
-
1All that has been posted is a program description. However, we need you to [ask a question](//stackoverflow.com/help/how-to-ask). We can't be sure what you want from us. Please [edit] your post to include a valid question that we can answer. Reminder: make sure you know [what is on-topic here](//stackoverflow.com/help/on-topic), asking us to write the program for you and suggestions are off-topic. – Kyll Jun 12 '17 at 11:29
1 Answers
-1
I solved it with reference to following post
int finalHeight, finalWidth;
final ImageView iv = (ImageView)findViewById(R.id.scaled_image);
final TextView tv = (TextView)findViewById(R.id.size_label);
ViewTreeObserver vto = iv.getViewTreeObserver();
vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
public boolean onPreDraw() {
iv.getViewTreeObserver().removeOnPreDrawListener(this);
finalHeight = iv.getMeasuredHeight();
finalWidth = iv.getMeasuredWidth();
tv.setText("Height: " + finalHeight + " Width: " + finalWidth);
return true;
}
});

Chandana_Raj
- 116
- 2
- 13