1

スクロール時に境界線がぼやける可能性はありますか? 理解を深めるために、達成したいことの写真を追加しました。

私が持っている制限は、その下にScrollViewer背景画像があることです。Rectangleしたがって、の左側にある白から透明へのグラデーションで塗りつぶされたものを使用することはできませんScrollViewer

ここに画像の説明を入力

4

1 に答える 1

2

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、例のようにいくつかの値を微調整して、独自の設定で正確に見えるようにする必要があるかもしれませんが、概念はそこにあるべきであり、オプションです。お役に立てれば。

于 2013-04-19T14:33:22.433 に答える