Sunday, January 26, 2014
Activity under load with ViewPager android or ViewFlow, but custom animations Activity switching failure
Recently worked on a project, you need to use the switching activity between the loading activity with ViewPager or ViewFlow can slide the screen switching.
In addition, the layout of my activity corresponding button set inside, they can click on each switch these activity, I used overridePendingTransition () from the definition of activity of transition effects. But in ViewPager or ViewFlow, these transitions are invalid.
Looking for a long time could not find a solution, Great God help! Thank you!
Reply:
Their top Great God ~ ~ wait
Reply:
General use ViewPager is to him the kind of smooth sliding it really did not add too animated
Add animation using viewFlipper, but feel the effect of this thing I do not like
Otherwise it
direct overwrite gallery
Seeking answers to the same
Reply:
Is to obtain a smooth sliding screen while switching animations and custom animations, so tangled for a long time, ViewPager, ViewFlow, gallery of the content view, loaded via addView function activity to display content activity, but this self-loading method while making animation definition invalid. I do not know if this is not android requirements.
Great God appears to continue to wait.
Reply:
I suddenly thought of a thing called single-frame layout, is the legendary frameLayout, looks like you can reach your requirements
There, gallery can add animation
Reply:
Can say specifically, single-frame layout how to use nested layout before it? Then what?
Reply:
frameLayout seemingly no viewFlipper easy to forget, or to consider adding animation to the gallery it
I try to use the same method can not be applied to viewPager
Reply:
I thought of another way to go. Or use ViewPager load the activity, and then set the instance ViewPager the public. Click on the button when switching activity can call setCurrentItem () method ViewPager, so that there can be switched animation. But only ViewPager for switching animation. This is a compromise solution.
Thank you for your answer!
Also, I would like to ask you about heroes, when the phone is set no window animation when I wrote it myself animations are ineffective, why animation ViewPager There UC browser or all effective? Do you know one of the principle? Thank you!
Reply:
I only now understand what you want to do. . . So you are loading activity rather than use ViewPager View, this is no solution for it. . . viewPager only loading view
If you want activity, then it should be anyway with tabactivity or tabhost tab to simulate it
Off the animation that I do not know. . . But there is no possibility that they simply can not achieve with animation, so off stubborn. . .
Reply:
I looked at the source, he is not using animation, is a thing called scroller
Animation is estimated that this thing is not right
Reply:
This is not very good, Bangding one, hope the early settlement of the landlord
Reply:
Thank you!
Reply:
http://topic.csdn.net/u/20120224/11/e2279270-c5b8-4ee2-80b5-23d2e727a768.html?r=77740344 might be able to help you!
Reply:
lz my dear friend, you can do this need to solve the code sent to you I have encountered similar problems can enlighten us about it very grateful to my mailbox is 1976006509@qq.com
Reply:
You can refer to the links to the 12th floor, I also use a similar approach, the ViewPager as a global variable, press the button switching method is called ViewPager can. I hope I could help.
Reply:
I go, I see the blind, who can tell me how to use ViewPager or ViewFlow switching activity, plus help the next QQ 820825987
Reply:
I have encountered this problem, from A Activity (unused ViewPager) into BActivity (using ViewPager) animation normal, but B returns to A lapse animation. The solution is to rewrite the onPause ()
For example:
protected void onPause () {
super.onPause ();
overridePendingTransition (R.anim.push_right_in, R.anim.push_right_out); / / return animation
}
@ Override
public boolean onKeyDown (int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount () == 0) {
finish ();
/ / OverridePendingTransition (R.anim.push_right_in, R.anim.push_right_out); / / return animation
}
return super.onKeyDown (keyCode, event);
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment