7
votes

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();
}
2

2 Answers

0
votes

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

0
votes

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.