mRulerX = ruler;
mRulerY = ruler;
- SetOvershootEnabled(true);
-
self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL, mCanScrollVertical);
self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL, mCanScrollHorizontal);
void ScrollView::EnableScrollOvershoot(bool enable)
{
- if(enable && !mOvershootIndicator)
- {
- mOvershootIndicator = ScrollOvershootIndicator::New();
- }
- if( enable )
+ if (enable)
{
+ if (!mOvershootIndicator)
+ {
+ mOvershootIndicator = ScrollOvershootIndicator::New();
+ }
+
mOvershootIndicator->AttachToScrollable(*this);
}
else
{
mMaxOvershoot = mUserMaxOvershoot;
- mOvershootIndicator->DetachFromScrollable(*this);
+
+ if (mOvershootIndicator)
+ {
+ mOvershootIndicator->DetachFromScrollable(*this);
+ }
}
+
UpdateMainInternalConstraint();
}