Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Android slider view offset

$
0
0

Hi everyone!

I wanted to put a slider inside of my forms page but noticed an offset from the actual buttom to move the slider. Pictures are attached at the end of this post. First one shows the slider on my device, the second one shows the picture from the Forms documentation.
Tested on emulator Android 4.1.1 and Android 4.3

Here is my xaml layout:

<AbsoluteLayout
    x:Name = "layout" >
    <Image
        x:Name = "backgroundImage"
        Source = "image.jpg"
        Aspect = "AspectFill"
        AbsoluteLayout.LayoutBounds = "0, 0, 1, 1"
                AbsoluteLayout.LayoutFlags = "All" />
       <Slider
        x:Name = "slider"
        BackgroundColor = "Black"
        Maximum = "20"
        Minimum = "5"
        Value = "5"
        AbsoluteLayout.LayoutBounds = "0, 1, 1, 0.15"
                AbsoluteLayout.LayoutFlags = "All" />
    <StackLayout 
        Orientation = "Horizontal" 
        BackgroundColor = "Black"
        Padding = "10, 0, 10, 0"
        AbsoluteLayout.LayoutBounds = "0, 1, 1, 0.05"
                AbsoluteLayout.LayoutFlags = "All" >
        <Label Text = "5" HorizontalOptions = "StartAndExpand" />
        <Label x:Name = "testLabel" Text = "10" HorizontalOptions = "CenterAndExpand" />
        <Label Text = "20" HorizontalOptions = "EndAndExpand" />
    </StackLayout>
</AbsoluteLayout>

Does anyone know why this is happening?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>