Ionic scroll delegate: reset scroll position after navbar click - scroll

I don't know what is happening, but I post this here cause maybe I have a mistake, not Ionic.
So here is the problem: after change scroll view I push at navbar and scroll position resets at {left: 0, top: 0}. Zoom params doesn't change.
Here is an example I made:
http://codepen.io/anon/pen/PPVjry
How can I fix it if it possible?
P.S. I didn't find any github issues or anything.

It happens with lists too. Try adding this to your ion-nav-bar element:
no-tap-scroll="true"
Here is the reference.

Related

Wrong UITableView position after pull to refresh

in my app this is the tableview position:
When i run pull to refresh, the position is:
Why does the tableview stay down?
Can you show us how do you use the UIRefreshControl in your code ?
Looks like you probably miss a refreshControl.endRefreshing()

Safari force page scroll position to top failed when page refresh

I am building a website using react to implement.First, we scroll the page to the bottom or middle position.Then we click refresh button in the iphone safari browser,page scroll to the permanent position strangely.I have tried to change the flex layout to float layout and add pageshow event listener to set scrollTop zero using
window.scrollTo(0,0)
.But page still stop at the permanent position in safari mobile.
I guess the problem is the page save the position of last view, but when page fresh, the content of the page is not show completely, and then the page could only scroll to the permanent position.At last, the rest part of the page show out.And the pageshow event has been triggered early before the page scroll to the permanent position.
How can I force the page to be scrolled to the top on page refresh except window.scroll? How can I solve this strange behavior of the safari browser?
I have the same issue as you using react on ios safari, the only fixed I found is to use a setTimeout in componentDidMount, but I really don't like this solution
componentDidMount() {
setTimeout(() => {
window.scrollTo(0, 0);
}, 800);
}
Hope it'll help
use window.scroll(0, 0) instead of window.scrollTo()

UIPageViewController with scrollview odd inset bounce

Storyboard Screenshot
I wonder if anyone can shed any light on this for me.
I have a UIPageViewController as part of a SWRevealViewController structure as seen in the storyboard in the linked picture.
The UIPageViewController contains a series of UIViewControllers which have a vertical scroll views in them. The first page shows fine but when I swipe left to display a new page the view loads about 30 pixels to high and after 0.5 a second it drops down to the right place. After that when you scroll left and right it displays normally.
I have tried everything in this post so far and nothing has worked.
self.automaticallyAdjustsScrollViewInsets = false;
pageViewController.automaticallyAdjustsScrollViewInsets = false;
I am pretty sure it is something to do with UIPageViewController scroll inset but not sure what to do about it as I have tried everything I can think of in the last 3 days to try and fix this.
Thank you in advance
Not sure if this will help you, but I had a smaller 5px bounce issue scrolling images in a UIPageViewController. Nothing in the post you look through helped me either. But using a separate UIView as a container view between the individual page view controller's view and my UIImageView miraculously solved the issue for me.
So the hierarchy you want in your page's view controller's view is:
Main View
Container View
Your Actual view content

Infinite UIScrollView in both direction

I would like to create an infinite scrollView (like a slot machine), but without paging. When the user scrolls down, it's easy i just have to increase the contentSize and the scrollView scroll endlessly :
- (void)scrollViewDidScroll:(UIScrollView *)theScrollView {
theScrollView.contentSize = CGSizeMake(45, theScrollView.contentSize.height+45);
}
But how can i create the same effect when the user scrolls upward ? I tried to play with the contentInset but then the contentOfsset doesn't get updated and i end up having weird behaviour.
Do you have any idea how i could achieve that ?
I needed the same, so I created this: http://dev.doukasd.com/2011/04/infinite-scrolling-dial-control-for-ios/
Have a look at the video, I believe it's what you're looking for. Source code is included.
I have developed this kind scroll view. It can scroll infinite.
You can check on github: https://github.com/quangrubify/InfiniteUITableView
I think you should give us more details about the issue. What content do you want the user to see when he is scrolling upwards? You increase the contentSize in scrollViewDidScroll method, but you are not checking the contentOffset, so the contentWill be bigger whenever the user scrolls the scrollView (either way, even horizontal if allowed). Since the contentOffset is already at 0, the user cant scroll upwards because there is nothing that the scroll view can show.
I dont know the content of your scrollView, but I have implemented infinite scrolling horizontally. For details, see: https://stackoverflow.com/a/12856174/936957
PS: Do not use "magic numbers", this is a better alternative:
theScrollView.contentSize = CGSizeMake(theScrollView.contentSize.x, theScrollView.contentSize.height+45);
//Or theScrollView.frame.size.width alternatively

CSS drop-down being overlapped by content in IE7

I'm having this issue in IE7 with my drop down. Whenever I hover over my dropdown it goes up as soon as i hover over an element on top of the content. http://www.legrandconfectionary.com/gift-boxes/
I thought a position: relative on the header would solve the problem but on certain pages like the truffle flavors I have a tooltip effect that goes under the nav if done so. I'd really appreciate some help on this. Thanks!
There are several ways that you can fix this. Here's two:
Set the a tag to display: block, and then make your hover events based on the a instead of the li.
or
Specify a height other than auto or 100% for the li's

Resources