1
votes

I have a problem that I can't solve. I need to scroll a StackPannel Horizontally with a ScrollViewer inside a Grid. This works but is incorrect gesture, to scroll forward I need to diagonally swipe down and back diagonally up. I need this to work normally swipe left and right.

<Grid ScrollViewer.HorizontalScrollBarVisibility="Auto"  >
<ScrollViewer Height="130" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Disabled" Margin="0,0,70,-3"  >
<StackPanel Height="73" Margin="0,0,0,50" Width="30956" Orientation="Horizontal"  >

<!-- Here i have a lot of buttons -->

</StackPannel>
</ScrollViewer>
</Grid>

I've tried to play with ScrollViewer.Horizontal and VerticalBarVisibility for StackPannel and Grid but with no succes!

1

1 Answers

0
votes

You need to remove the horizontalScrollBarvisibility on the scrollviewer. I.e

<Grid>
    <ScrollViewer Height="130" HorizontalScrollBarVisibility="Visible"     VerticalScrollBarVisibility="Disabled" Margin="0,0,70,-3"  >
        <StackPanel Height="73" Margin="0,0,0,50" Width="30956" Orientation="Horizontal"  >


        </StackPannel>
    </ScrollViewer>
</Grid>