スクロール時に境界線がぼやける可能性はありますか? 理解を深めるために、達成したいことの写真を追加しました。
私が持っている制限は、その下にScrollViewer
背景画像があることです。Rectangle
したがって、の左側にある白から透明へのグラデーションで塗りつぶされたものを使用することはできませんScrollViewer
。
スクロール時に境界線がぼやける可能性はありますか? 理解を深めるために、達成したいことの写真を追加しました。
私が持っている制限は、その下にScrollViewer
背景画像があることです。Rectangle
したがって、の左側にある白から透明へのグラデーションで塗りつぶされたものを使用することはできませんScrollViewer
。
WinRT は のサポートを終了したためOpacityMask
、アルファ チャネルで設定するかどうかはわかりません。とはいえ、ほとんどの場合、回避策があります。では、代わりに自然な z オーダーを利用してそれを偽造するとどうなるでしょうか? このようなもの;
<!-- Grid as Container -->
<Grid>
<ScrollViewer VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Visible">
<!-- example backgrounds, like images, just for the concept example. -->
<StackPanel Orientation="Horizontal">
<Rectangle Height="75" Width="300" Fill="Red" Margin="20,0"/>
<Rectangle Height="75" Width="300" Fill="Red" Margin="20,0"/>
<Rectangle Height="75" Width="300" Fill="Red" Margin="20,0"/>
<Rectangle Height="75" Width="300" Fill="Red" Margin="20,0"/>
<Rectangle Height="75" Width="300" Fill="Red" Margin="20,0"/>
</StackPanel>
</ScrollViewer>
<!-- An adhoc gradient overlay to just float over the ScrollViewer itself.
Then using Margin to fit it to the shape of the Scrollviewer and still
allow hit visibility to the scrollbar etc. -->
<Rectangle Width="50" HorizontalAlignment="Left" Margin="1,1,0,20">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="1,0.5" StartPoint="0.1,0.5">
<GradientStop Color="White" Offset="0.3"/>
<GradientStop Color="Transparent" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
</Grid>
もちろんRectangle
Margin
、例のようにいくつかの値を微調整して、独自の設定で正確に見えるようにする必要があるかもしれませんが、概念はそこにあるべきであり、オプションです。お役に立てれば。