none
(WP8.1)滚动条如何使用? RRS feed

  • 问题

  • <ScrollViewer IsEnabled="True">
                        <ScrollViewer.Content >
                            <TextBlock FontSize="24" Foreground="Black" TextWrapping="Wrap" CharacterSpacing="2" HorizontalAlignment="Left" Height="441">                   
                         内容
                            </TextBlock>
                        </ScrollViewer.Content>
                    </ScrollViewer>

    为什么这样使用滚动条,添加的大量内容后不能滚动?

    正确应如何添加滚动条控件?

    2016年4月4日 9:26

答案

  • 您好,

    就只是看你的ScrollViewer,我没有发现什么问题,您是不是在外层容器有设置什么属性?

    请参考我的代码,我已经测过,可以滚动:

    <StackPanel >
            <ScrollViewer Height="200" Width="200" 
                        HorizontalScrollBarVisibility="Auto" 
                        VerticalScrollBarVisibility="Auto">
                <TextBlock Width="441" TextWrapping="Wrap" FontSize="24" Foreground="Black" CharacterSpacing="2" HorizontalAlignment="Left"
                  Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ac mi ipsum. Phasellus vel malesuada mauris. Donec pharetra, enim sit amet mattis tincidunt, felis nisi semper lectus, vel porta diam nisi in augue. Pellentesque lacus tortor, aliquam et faucibus id, rhoncus ut justo. Sed id lectus odio, eget pulvinar diam. Suspendisse eleifend ornare libero, in luctus purus aliquet non. Sed interdum, sem vitae rutrum rhoncus, felis ligula ultrices sem, in eleifend eros ante id neque." />
            </ScrollViewer>
            
        </StackPanel>


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2016年4月5日 2:25
    版主