2015-10-07 120 views
6

我在我的离子应用程序中使用$ anchorscroll,在Android上它工作正常,但在iOS上我的内容在滚动后卡住,我无法再向上滚动。离子anchorscroll不能在iOS上工作

我尝试使用溢出滚动=“真”,但是这并不在我的应用程序工作,要么...

有人可以帮我这一个吗?

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

回答

0

This似乎是一个类似的问题。他们似乎拨打$ionicScrollDelegate.anchorScroll();而不是$anchorScroll();。可能这是你的问题?

0

试试这个。它适合我。 步骤要遵循, 在Xcode中打开你的iOS平台,并添加以下代码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; 

    } 

希望如此,它会为你工作。