i'm looking how to create animations from segue into all 4 directions (up, down, left, right). My aim is to link them to swipes, so that in the direction you swipe the screen moves to the next screenview.
can anyone advise on this? I have been googling a lot and not find a working solution yet.
thanks!
Related
I have a MKMapView with a draggable MKPinAnnotationView which is generally working well, but there are 2 significant issues:
Once I am dragging, if I reach the left, right or bottom of the map, it seamlessly scrolls the map as you would expect. However, when I drag upwards, about ~50px away from the top of the map it just stops and won't pan the map upwards.
The click target for the drag operation is tiny and pretty challenging to hit. Once I find the exact spot it works pretty well, but it's surprising it is so small. I've tried playing with the size of my custom pin image but it hasn't made a difference.
What could be causing these issues? Everything else about it is working great. Thank you!
I am a teacher and I am trying to make a page for my students showing the comparative size of the planets and the stars, like in one of those videos that are popular in Youtube.
But I have not been able to solve the problem, the closest I got was using "if window.pageXOffset > 1000" animate width etc. but what I really wanted was for the planets and stars (images) to scroll into view at 100% height and then as the page scrolled towards the right, they´d shrink down till 0% when reaching the left border (left=0px), while the next and next planet scrolled into view (showing 3 or 4 at a time) and so forth. The page should allow the user to scroll back and forth at will.
I tried the transform: scale method but wasn´t successful either.
Any help will be greatly appreciated.
You were going the right direction with using transform: scale(), and I've taken that and run with it. See the following jsfiddle:
https://jsfiddle.net/2z4djt0o/5/
During a scroll event, we look at each planet and decide what its scale should be depending on where it is relative to the left and right edges of the scrolling viewport.
I've been using Xcode and i don't know whats going on when i type in a text field it feels as if its lagging and when a UIAlertView Pops up a grey background is overplayed but some reason how it is appearing on screen is that it moves diagonally from the top right and it moves slowly.
Help would be much appreciated :D
Is there any easy way to let a disclosure button points left and right instead of up and down?
Create your own graphic and rotate the image.
in my opinion the iPhone has a big advantage to other smartphones because of its intuitive, smooth and good feeling scrolling components in UIKit. I want to implement a simple game with UIKit which uses this kind of scrolling, but i can't use UIScrollView because it isn't customizable enough.
I tried to implement this scrolling myself and tried two different approaches:
I used a UIPanGestureRecognizer und moved the bounds of my custom control according to the translation the recognizer delivers me. In order to get this smooth scrolling after lifting my finger during the movement I start an animation. I use the velocity the recognizer gives me and a fixed time in order to calculate how far it should scroll after I lifted my finger. I tryed a linear movement and a ease-out movement, but both looks strange. (more later on that)
I use OnTouchMoved and OnTouchEnded to implement the scrolling. In OnTouchMove I move the bounds according to the movment of the finger. While the finger moves I calculate the difference in location and time of the current and last touch in order to calculate a velocity myself. When the finger lifts I start an animation in OnTouchEnded like in 1. but I use my self-calculated velocity instead.
Both approaches are not giving me the results I want. After lifting my finger, the scrolling is not smoothly continued. There seems to be a (sharp) bend in the celocity curve.
Has anyone an idea how apple does this smooth scrolling? My current guess is that my interpolation with two really close points is to inaccurate and doesn't take the current acceleration into account.
Thx for your thoughts!
Kie
Why don't you add a UIScrollView as handle on top of your view, without visible content. Then you can use the UIScrollViewDelegate methods to update your real view on certain actions. For example: if you capture the scrolling of the UIScrollView using scrollViewDidScroll: , you can update your visible view with the offset of the scrollview. You can use the scrollViewWillEndDragging: to start synchronizing the main view with the scrollview, and scrollViewDidEndDecelerating to stop synchronizing.
I use the same approach to scroll the background of my Animix app. It has an invisible scrollview at the bottom, to give the user the feeling he can drag the grass to the left and right to move the background.