[英]Add scrollviewer to grid
如何將滾動查看器正確添加到此布局?
我嘗試將垂直scrollviewer添加到我的主網格中,但是沒有用。
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="White" ScrollViewer.VerticalScrollBarVisibility="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="0" Margin="12,17,0,28"/>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Margin="12,167,8,-588" Grid.RowSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="169*"/>
<ColumnDefinition Width="287*"/>
</Grid.ColumnDefinitions>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="25,21,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Search" Grid.ColumnSpan="2" ImageSource="/Assets/Apps-Magnifier-Metro-icon.png"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="76,21,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Grid.Column="1" Title="How It Works"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="25,196,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Physiotherapists" Grid.ColumnSpan="2"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="76,196,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Articles Of Week" Grid.Column="1"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="25,364,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Blog Of Week" Grid.ColumnSpan="2"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="76,364,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Pod Casts" Grid.Column="1"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="25,549,0,-111" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Jobs" Grid.ColumnSpan="2"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="76,549,0,-111" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Courses" Grid.Column="1"/>
</Grid>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="41,17,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="About Us"/>
<telerikPrimitives:RadHubTile HorizontalAlignment="Left" Margin="255,17,0,0" VerticalAlignment="Top" Height="153" Width="168" Background="#25A1DA" Title="Contact"/>
</Grid>
您的scrollviewer
器只能包含1個元素。 知道您必須使grid
可滾動而不是它的內容
它看起來像這樣:
<ScrollViewer>
<Grid x:Name="LayoutRoot" Background="White">
//Content here
</Grid>
</ScrollViewer>
網格需要滾動。 不是里面的控件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.