문제

Is there a way I can get a reference to the Views that onFling has not yet revealed? I'm extending Gallery, and in my onFling method, of course I can get the current View (the one that is showing already). But I haven't found a way to get the views that are about to be flung by. I need to change properties like backgroundColor (it's a Gallery of TextViews).

도움이 되었습니까?

해결책

There's a nifty method for handling each onFocus event in a gallery fling. As each item comes into focus, this will get fired.

thisGallery.setOnItemSelectedListener(new OnItemSelectedListener() {
   @Override
   public void onItemSelected(AdapterView<?> parentView,
                              View selectedItemView,
                              int position,
                              long id) { }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top