Ionic anchors do not work on iOS

I use $ anchorscroll in my ionic app, on Android it works fine, but on iOS my content gets stuck after scrolling, I can no longer scroll.

I tried using overflow-scroll = "true", but this does not work in my application ...

Can someone help me with this please?

function scrollTo() { console.log("scroll to: " + $stateParams.id); var anchor = ''; if($stateParams.id === '') { console.log("empty"); anchor = "birthday-test"; } else { console.log("not empty"); var employee_id = $stateParams.id; anchor = "birthday-" + employee_id; } console.log("anchor : " + anchor); $location.hash(anchor); $anchorScroll(); } 
+6
source share
2 answers

Try it. He works for me. Step to follow: Open the iOS platform in xcode and add the code below in AppDelegate.m

  - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; //scrolling view self.viewController.webView.scrollView.bounces = NO; self.viewController.webView.opaque = NO; self.viewController.webView.backgroundColor = [UIColor blackColor]; //Scrolling hidden . self.viewController.webView.scrollView.scrollEnabled =false; self.viewController.webView.scrollView.scrollsToTop =false; return YES; } 

Hope this works for you.

0
source

All Articles