I have extended LinearLayout (vertical) to create a custom compound component. This in turn contains two children:
- one custom view that is drawn directly onto the view canvas.
- one HorizontalScrollView->LinearView(Horizontal)->Multiple custom views.
I would now like to redraw the custom view to ma开发者_Python百科tch the visible contents of the scroll view. The reason for this is that the long array of custom components in the scroll view are mainly static and suitable to be drawn ahead of time, while the top view is supposed to be highly dynamic and relate to whatever things are visible in the scroll view.
I hope I made the problem/idea somewhat clear. I am not att all confident this is the best approach, and I'd enjoy hearing any suggestions on alternative solutions or perhaps some idea on how to trigger a redraw-event everytime the scroll position changes in the HorizontalScrollView.
Thank!
You can have your activity listen to the scroll view adapter. in the adapter when ever the scroll position changes you execute the delegate in the Activity. That way the activity can update the rest of the views upon scroll view change.
精彩评论