)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to change Touch Threshold in NavigationDrawer control

Platform: Xamarin.Forms |
Control: SfNavigationDrawer |
Published Date: March 31, 2017 |
Last Revised Date: June 24, 2019

Syncfusion NavigationDrawer in Xamarin provides TouchThreshold property to set position from where the slider opens when dragging over the screen.

 

To change the TouchThreshold in NavigationDrawer follow the given procedures below.

 

Step 1: Create sample of Navigation Drawer and set the value for TouchThreshold.

 

Step 2: The drag position from where the slider gets opened will vary depending on the value of TouchThreshold.

 

XAML code to change TouchThreshold of Navigation Drawer:

<navigation:SfNavigationDrawer x:Name="navigationDrawer"  EnableSwipeGesture="true" Position="Left" Transition="Push" TouchThreshold="100" DrawerHeight="100" DrawerWidth="200" DrawerHeaderHeight="100" DrawerFooterHeight="100"> 
<!-- We can change the TouchThreshold to any value as per the user needs -->
  <navigation:SfNavigationDrawer.ContentView>
<StackLayout x:Name="ContentFrame" Orientation="Vertical" >
  <Label Text="Main Content View of SfNavigationDrawer." HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" />
</StackLayout>
</navigation:SfNavigationDrawer.ContentView>
<navigation:SfNavigationDrawer.DrawerHeaderView>
<Grid x:Name="headerLayout" BackgroundColor="#1aa1d6" >
  <Label x:Name="header"  Text="Header View" FontSize="14" TextColor="White"  VerticalTextAlignment="Center" HorizontalTextAlignment="Center"  />
</Grid>
</navigation:SfNavigationDrawer.DrawerHeaderView>
<navigation:SfNavigationDrawer.DrawerFooterView>
<Grid x:Name="footerLayout" BackgroundColor="#1aa1d6" >
  <Label x:Name="footer"  Text="Footer View" FontSize="14" TextColor="White"  VerticalTextAlignment="Center" HorizontalTextAlignment="Center"  />
</Grid>
</navigation:SfNavigationDrawer.DrawerFooterView>
    <navigation:SfNavigationDrawer.DrawerContentView>
        <StackLayout >
        <Label Text="Drawer Content View"  VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand"/>
        </StackLayout>
    </navigation:SfNavigationDrawer.DrawerContentView>
</navigation:SfNavigationDrawer>  
 

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon