Replies: 4 comments 5 replies
-
Yes, it is by design, and it coverts only when you hover the scrollbar. |
Beta Was this translation helpful? Give feedback.
-
I have the same issue with vertical scrollbar of As you can see, I was lucky enough to have some <!-- apply Classes="fixedScrollbar" to a ScrollViewer, which vertical scrollbar overlaps -->
<Style Selector="ScrollViewer.fixedScrollbar">
<Setter Property="ClipToBounds" Value="False"/>
<Style Selector="^ /template/ ScrollBar:vertical">
<Setter Property="Margin" Value="0,0,-10,0"/>
</Style>
</Style> Now it looks acceptable: |
Beta Was this translation helpful? Give feedback.
-
Try this:
|
Beta Was this translation helpful? Give feedback.
-
In addition on @timunie: Just add Explanation: According to the original Avalonia-style, the ScrollViewer consists of a 2x2 grid. Part of source of Avalonia style (ScrollViewer.AXAML): <Style Selector="^[AllowAutoHide=True] /template/ ScrollContentPresenter#PART_ContentPresenter">
<Setter Property="Grid.ColumnSpan" Value="2" />
<Setter Property="Grid.RowSpan" Value="2" />
</Style> Example to display scrollbars without overlapping contents: <Grid RowDefinitions="auto,*">
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Slider x:Name="sliderZoom" Minimum="1" Maximum="20" Value="1" Width="200"/>
<TextBlock Text="{Binding #sliderZoom.Value, StringFormat='{}Zoom factor {0}x '}"/>
</StackPanel>
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" AllowAutoHide="False">
<!--AllowAutoHide=False is necessary to be set, otherwise scrollbars will overlap contents-->
<LayoutTransformControl>
<LayoutTransformControl.LayoutTransform>
<ScaleTransform ScaleX="{Binding #sliderZoom.Value}" ScaleY="{Binding #sliderZoom.Value}"/>
</LayoutTransformControl.LayoutTransform>
<Panel>
<Rectangle Width="50" Height="50" Fill="CornflowerBlue"/>
<Rectangle Width="5" Height="5" Fill="Red"/>
<Rectangle Width="0.5" Height="0.5" Fill="Yellow"/>
</Panel>
</LayoutTransformControl>
</ScrollViewer>
</Grid> |
Beta Was this translation helpful? Give feedback.
-
I have some content in my scroll viewer and I should be able to interact with it. This cannot be done since vertical scrollbar covers this content. I could set right padding to 20px and this would solve the issue. However, if I set
VerticalScrollBarVisibility="Auto"
it kind of beats the purpose since if there arent that many items then scroll bar will not be displayed and I will be left with a 20px gap on right.I have tried applying a style as such to aleviate the issue because from what I can see in the control template it is made by design so the control can Autohide(
AllowAutoHide
) scroll bar without constant content push. This is what I have tried but it doesn't work.The only consisten behavior I can get is if I set
VerticalScrollBarVisibility="Visible"
and setPadding="0,0,20,0"
. This way I will always have scroll bar visible and padding applied.Beta Was this translation helpful? Give feedback.
All reactions