Ionic anchorscroll not working on iOS
Asked Answered
R

2

7

I'm using $anchorscroll in my ionic application, on Android it works fine but on iOS my content gets stuck after scrolling, I can't scroll up anymore.

I tried using overflow-scroll="true", but this doesn't work either in my application...

Can someone help me with this one 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();
}
Roney answered 7/10, 2015 at 9:49 Comment(0)
J
0

This appears to be a similar question. They appear to call $ionicScrollDelegate.anchorScroll(); instead of $anchorScroll();. Possibly this is your issue?

Janusfaced answered 22/2, 2016 at 11:28 Comment(0)
E
0

Try this.It work for me. Step to be follow, Open your iOS platform in xcode and add below code 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 so it will work for you.

Effluent answered 27/2, 2016 at 12:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.