Android TranslateAnimation after scrollTo() = undrawn view
This might be a "duh" question but I'm going to go ahead and ask it anyway.
I have an oversized (bigger than the screen) RelativeLayout, and I'm using swipes to start a TranslateAnimation from viewing one part of the layout to another. Say for instance the layout is two screen wide and two screens tall. After the nice animation to shift the screen, I was using View.scrollTo() to set the new position. This works fine going from the first screen (top left at 0,0) to one of the others. When I swipe to animate back to the first screen though, because the View.scrollTo() invalidated that part of the layout (I assume), that part of the layout is all black as I animate through it. I tried a couple things to get it to redraw itself after the scrollTo() but haven't had any lu开发者_如何学编程ck, so I figured I'd ask here.
thanks! joe d
I can't help with your specific problem since I've never tried working with a layout bigger than the screen, but there might be another way to achieve what you're trying to do. If you simply want to be able to finger-swipe from one View to another, without ever displaying part of one screen and part of another (i.e. you aren't smoothly panning around a large View but rather just jumping from one distinct section of the layout to another), then these tutorials might help, here and here. They show you how to use touch events and the ViewFlipper widget to change between Views using animations.
精彩评论