48403

Xamarin.Forms Slider iOS gesture failure

Question:

When I try to use the Slider on iOS it slides out the Master menu. It works fine on Android.

One option would be to disable gestures all together but I haven't found a way to disable them for only that page. I would very much like to keep the sliding gestures for the other pages without sliders.

Answer1:

It sounds like your slider may be too close to edge of the page. If your design allows it, try adding a margin to the left and right of the slider.

<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:SliderTest" x:Class="SliderTest.MainPage"> <StackLayout Orientation="Vertical" VerticalOptions="Center"> <Slider Margin="10,0,10,0"/> </StackLayout> </ContentPage>

And in case you need separate margins for iOS and Android, you can do that like this:

<StackLayout Orientation="Vertical" VerticalOptions="Center"> <Slider> <Slider.Margin> <OnPlatform x:TypeArguments="Thickness" iOS="10,0,10,0" Android="20,0,20,0"/> </Slider.Margin> </Slider> </StackLayout>

Recommend

  • “Working” script returning Uncaught DOMException: Failed to execute 'insertBefore' on 
  • CSS Bundling and Internet Explorer's Limit
  • Function to check if jquery plugins are already initialized
  • Xcode Color picker automatically changing HSB color
  • Best strategy to handle incoming midi signal from MIDIReadProc in cocoa
  • How do you download a image/png data URI in Edge?
  • Controlling tab space in a using CSS?
  • Remove border around the color in an input[type=color] in Firefox?
  • Overriding window.location on Webbrowser Control
  • Price range slider for my website
  • How to get value of the slider, when touchend or mouseup events are used?
  • Keep transition effect on 1 div from moving the div that follows?
  • How can I see a list of all files that are different between two Hg repositories?
  • Receive mouse move even cursor is outside control
  • Request response issues in biztalk
  • Xamarin Android | Layout style
  • How to convert SOAP response with xsi values to json in WSO2esb
  • Overlapping controls in Windows XP
  • Can I programmatically choose the Android layout folder?
  • How do I include a SWC in an AS2 Flash project?
  • How to add a focus style to an editable ComboBox in WPF
  • How to get current document uri in XSLT?
  • JBoss External Properties Files in Classpath
  • How do I superscript characters in a UIButton?
  • Why Encoding.ASCII != ASCIIEncoding.Default in C#?
  • Bad request using file_get_contents for PUT request in PHP
  • Encrypt data by using a public key in c# and decrypt data by using a private key in php
  • Is my CUDA kernel really runs on device or is being mistekenly executed by host in emulation?
  • Optimizing database types to compact database (SQLite)
  • recyclerView does not call the onBindViewHolder when scroll in the view
  • TFS: Get latest causes slow project reloading
  • Controls, properties, events and timers running in design time
  • SSO with signing and signature validation doesn't work
  • Running a C# exe file
  • Deserializing XML into class C#
  • Arrow is showed instead of the material design version hamburger icon. Why doesn't syncState in
  • How to include full .NET prerequisite for Wix Burn installer
  • costura.fody for a dll that references another dll
  • Reading document lines to the user (python)
  • jQuery Masonry / Isotope and fluid images: Momentary overlap on window resize