0

I have a Custom View, that is extend ViewGroup. It is quite logical that I must implement onLayout method. I've try to look this and this answers, but actually can not understand what I need to do exactly.

Some provisional information :

I have a ViewGroup and all data passed to this ViewGroup pass via Adapter. It very similar to ListView & Adapter communication mechanism.

enter image description here

My case is the same

enter image description here

When I looked answers for the questions above, I've mentioned that ViewGroup before layouting knows, what the count of children he has.

final int childCount = getChildCount();

In my case I doesn't have any idea how to told ViewGroup

"Hey you have <value> children!".

So I need probably more explanation of onLayout implementation manual.

Community
  • 1
  • 1
Sergey Shustikov
  • 15,377
  • 12
  • 67
  • 119

0 Answers0