I use a navigation-based iOS application. I want to make a background similar to desktop wallpaper in Android.
So when I go to another View the current View and it's content goes outside of the screen but the background image slightly moves only.
See a sample screenshot here.
Why not have the base subview set to the size of the background wallpaper (ie larger than the screens width) and start with it left aligned. Then have a paged UIScrollView on top of that. When the user scrolls the UIScrollview, hook into the UIScrollViewDelegate method
- scrollViewDidScroll: and pass it through the the base subview, telling it to animate in accordance.
This shouldn't be too hard but you'll probably want to tweak it a bit to get the feel you want.Try playing about with the various delegate methods in the UIScrollViewDelegate protocol to determine the best time to start the animation.
Related
For my app, I plan to have a grid of images and when you select one the image increases in size and the rest of the images get grayed out. I read about Activity Transitions but have never implemented that before so I'm not sure if this is the appropriate way of achieving the correct affect. I was thinking of possibly using a fragment and an animation to display the image in a larger size but how do I display the activity in the background with a grey tint to it so that it looks out of focus? I'm looking here to see what you think the most appropriate method of making this work. Here is a gif of exactly what I'm trying to accomplish.
How can i implement home screen swipe feature of android for a user to swipe between 2 view which covers the entire page. During the swipe the View must animate 100%, but the background must move by only 20%.
I have extensively used: custom scroll view for my app using vertical scroling.
It should be possible to put a bitmap or the like in the background and then when user swipes, manually move/animate the bitmap a factor of 0.20, unless at the edge of the bitmap of course.
Or, as you indicate, having two views. Then you just have to somehow have to, either make the background view ignore user input and let the top view control it, or find a way to pass the input down to the background, having it automatically use a factor 0.20.
Have not tried something similar but believe the link above gives you a lot of control over what is happening.
I want my app to run on a wide variety of android devices in portrait only. I have a whole-screen background image that includes borders for other components. I want to place items like listviews/sponsor ads accurately within those borders... overlay them on top of the background in exactly the right place. Is using Framelayout the best/easiest way to do this? How do I make sure I get the listviews or sponsor ads in exactly the right place, and exactly the right size given that the background will be stretched to different dimensions for different devices? I've considered cutting up the background image instead but that seems like more work. What's the best approach? Thanks for any thoughts!
Unfortunately, this scheme is never going to work consistently across all screen sizes. If you want borders, you need to create 9-patch graphics out of those and assigne them as teh background to the UI item.
I wanna start a new project. A little "Jump n Run", but I have questions:
The levels will be bigger than the screen. How can I make a big Layout and edit it?
And how do the view "follows" the player, if he moves.
I dont want code samples. I only want basic ideas how to do it.
I suggest you have a look at the SurfaceView. It allows you to render bitmaps to the screen. In your case you could create a bitmap that is larger than the screen and have the user navigate it with the use of their finger (so you'll also have to also use your touchscreen). Basically what you will be changing when the user wants to go to a new location would be the src rect parameter in the drawBitmap method.
I hope this gets you started.
You could specify the layout to whatever pixel size you want (even if it's larger than any screen size would be), and then use scroll views to allow the user to scroll to other areas of the screen. Check out the Android developer docs on horizontal scroll view.
At the moment, I am using Euro 2012 app and it has some interesting layout parts. If you go to matches->knockout screen, you'll see 3 screens like this.
If you slide left or right, you move between them not like between one activity to another, but just like all these elements are laid on one big canvas and you slide each screen into focus. Even thou, if you slide left/right, the screen cannot be stopped in the way that half of each image is visible, so I guess it's not a big canvas. Somehow you can slide screen like one big image, and yet it always lock perfectly as if they used 3 activities for this.
How did the do this?
It's a ViewPager, available in Android support package and described in their blog.
The designing is not so much difficult, As i think to draw that boxes showing quarterfinals, semifinals.
They having layout( we can do by placing image in background also).
The major role played by FrameLayout which shows you that effect(emphasis), the flages are fetch from url as matches are decided(not essentially images only names are sufficient as flags came inside app and gets applied as updated).
After your click i think the start image gets change it's just replacing that image with new one.
As you said they are not on single canvas (but if they did customization of heir Viewpager that it's not stopping in between activities), but i think it's on single canvas.
If your taking about quickness of loading and all it's up to you as much code and processing you optimized it gives you smooth feel and fast processing.
We can appreciate the work but we can not say it's too much difficult as i think it's quit easy...
Hope this explanation helps you to understand ....