2014-02-26 55 views
0

我剛剛開始爲Windows Phone 8開發。我遇到了ScrollViewer控制器的問題。它最初是在工作,但現在當我點擊並拖動到面板的底部時,我可以看到內容,直到我釋放點擊,然後它纔回到視圖的頂部。ScrollView窗口的問題電話

我嘗試刪除我的動畫,並嘗試使用固定的堆棧面板高度。我也嘗試使用不同的網格行。會有語法錯誤嗎?這裏是XAML文件的一個片段,任何幫助將是非常讚賞:

<Grid x:Name="LayoutRoot" 
    Background="#FFDBDBDB"> 
    <i:Interaction.Triggers> 
     <i:EventTrigger> 
      <eim:ControlStoryboardAction Storyboard="{StaticResource PageViewAnimation}"/> 
     </i:EventTrigger> 
    </i:Interaction.Triggers> 
    <Grid.RowDefinitions> 
     <RowDefinition Height="Auto" MinHeight="100" /> 
    </Grid.RowDefinitions> 

    <StackPanel x:Name="TitlePanel" 
     Grid.Row="0" 
     Margin="12,0,0,0" Height="Auto" VerticalAlignment="Top"> 
     <Image x:Name="image1" Height="100" Source="/Assets/Logo/Logo.png" HorizontalAlignment="Left"/> 

    <ScrollViewer x:Name="scrollViewer" Grid.Row="1"> 
     <StackPanel x:Name="ContentPanel" 
       VerticalAlignment="Top" Margin="12,0,0,0"> 

      <!--CurrentJob--> 
      <Image x:Name="image" Stretch="UniformToFill" Margin="0,0,12,0" VerticalAlignment="Top" Source="{Binding BusinessCardImage}" RenderTransformOrigin="0.5,0.5"> 
       <Image.RenderTransform> 
        <CompositeTransform/> 
       </Image.RenderTransform> 
      </Image> 

      <!--CurrentJob--> 
      <TextBlock x:Name="currentJobLbl" HorizontalAlignment="Left" TextWrapping="Wrap" Text="Current Job" VerticalAlignment="Top" Margin="12,0,0,0"/> 
      <TextBox x:Name="currentJobTxt" 
       TextWrapping="Wrap" 
       Text="{Binding CurrentJob, Mode=TwoWay}" 
       VerticalAlignment="Top" 
       AcceptsReturn="True" 
       Visibility="{Binding IsEditMode, Converter={StaticResource TrueToVisibleConverter}}"/> 
      <TextBlock x:Name="currentJobTextBlock" 
       TextWrapping="Wrap" 
       Text="{Binding CurrentJob, Mode=TwoWay}" 
       VerticalAlignment="Top" 
       RenderTransformOrigin="0.5,0.5" 
       Visibility="{Binding IsEditMode, Converter={StaticResource FalseToVisibleConverter}}"/> 

      <!--Websites--> 
      <TextBlock x:Name="websitesLbl" HorizontalAlignment="Left" Margin="12,0,0,0" TextWrapping="Wrap" Text="Websites" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5"> 
       <TextBlock.RenderTransform> 
        <CompositeTransform/> 
       </TextBlock.RenderTransform> 
      </TextBlock> 
      <TextBox x:Name="websitesTxt" 
       TextWrapping="Wrap" 
       Text="{Binding Websites, Mode=TwoWay}" 
       VerticalAlignment="Top" 
       AcceptsReturn="True" RenderTransformOrigin="0.5,0.5" 
       Visibility="{Binding IsEditMode, Converter={StaticResource TrueToVisibleConverter}}"> 
       <TextBox.RenderTransform> 
        <CompositeTransform/> 
       </TextBox.RenderTransform> 
      </TextBox> 
      <TextBlock x:Name="websitesTextBlock" 
       TextWrapping="Wrap" 
       Text="{Binding Websites, Mode=TwoWay}" 
       VerticalAlignment="Top" 
       RenderTransformOrigin="0.5,0.5" 
       Visibility="{Binding IsEditMode, Converter={StaticResource FalseToVisibleConverter}}"> 
       <TextBlock.RenderTransform> 
        <CompositeTransform/> 
       </TextBlock.RenderTransform> 
      </TextBlock> 

       <Grid> 
        <Button x:Name="editSaveBtn" 
         Content="{Binding EditSaveButtonText, Mode=TwoWay}" 
         HorizontalAlignment="Center" 
         VerticalAlignment="Top" 
         Width="150"> 
         <i:Interaction.Triggers> 
          <i:EventTrigger EventName="Click" SourceName="editSaveBtn"> 
           <Command:EventToCommand x:Name="InvokeEditModeCommand" 
            Command="{Binding InvokeEditModeCommand, Mode=OneWay}"/> 
          </i:EventTrigger> 
         </i:Interaction.Triggers> 
        </Button> 
       </Grid> 
      </StackPanel> 
    </ScrollViewer> 
    </StackPanel> 
</Grid> 
+0

這是您的完整的代碼?是否有一些行爲或任何附加到scrollviewer可能會混淆命中可視性或任何東西?正如我所看到的那樣,我看不到他們在那裏有什麼其他的東西。 –

回答

0

嘗試更改網格行定義這樣:

<Grid.RowDefinitions> 
    <RowDefinition Height="Auto" MinHeight="100" /> 
    <RowDefinition Height="*" /> 
</Grid.RowDefinitions> 
+0

想着也許你打算回答一個不同的問題,而不是這個阿米戈?可能會再次重讀OP問題。 –

+0

你說得對,對不起。 –