1. 程式人生 > >cocos2dx pageview 設定滑動靈敏度

cocos2dx pageview 設定滑動靈敏度

今天用到cocostudio中的pageview,設定一個介面的滑動時候發現只能再滑動距離超過一半才能翻頁,感覺很是不好;

通過下面方法可以修改翻頁引數:

void PageView::setCustomScrollThreshold(float threshold)

{
    CCASSERT(threshold > 0, "Invalid threshold!");
    _customScrollThreshold = threshold;
    this->setUsingCustomScrollThreshold(true);

}

如設定pageview->setCustomScrollThreshold(100.0) 則可實現pageview的翻頁距離為100