Luke Wang
Luke Wang

Reputation: 153

How do you transition without the background moving?

I've looked around for a while and cant find the answer. How do you make a screen transition so that the background stays in place while the elements displayed move? Basically, Im trying to emulate the look for sliding through pages of apps on an iphone or android phone. Any way to do this? Do i have to use fragments? This question has kind of bad wording, ask me to clarify if you're confused on anything.

Upvotes: 0

Views: 69

Answers (1)

Lucas Crawford
Lucas Crawford

Reputation: 3118

Use a frame layout with the background set as an image that you want. with a view pager as a child view. The view pager will use different fragments and the view pager should have each Fragment with a transparent background. Let me know if you need help with that any more, it should work no problem.

If the background is more complicated, use another layout to hold child views and still have the main layout be a frame layout. You want the frame layout because it can stack views on top of eachother. Put the view pager as the last view in this case, and ensure each Fragment is transparent.

Upvotes: 3

Related Questions