2012-04-30 8 views
1

エミュレータのscrollviewerで助けが必要です。 xamlでそれについてのすべては大丈夫ですが、エミュレータでは... hmmのバグはありますか?それとも私の悪いですか?下にスクロールしたいときは、画面が1/3になります。リリースすると自動的に前の位置(開始位置)に移動します それが私の悪いのか分かりません。 ScrollViewerのは、それはだスクロールする必要がある、それはスクロールする必要がありますので、無限の空間を占有する前に、それは取ることができますどのくらいのスペースを知っているので、doens'tていないため、この問題が発生している...スクロールするビジュアルスタジオの電話エミュレータ

<phone:PhoneApplicationPage 
    x:Class="Excercises.Weider_s_six" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" 
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}" 
    FontSize="{StaticResource PhoneFontSizeNormal}" 
    Foreground="{StaticResource PhoneForegroundBrush}" 
    SupportedOrientations="Portrait" Orientation="Portrait" 
    mc:Ignorable="d" shell:SystemTray.IsVisible="True" d:DesignHeight="768" d:DesignWidth="480"> 

    <!--LayoutRoot is the root grid where all page content is placed--> 
    <Grid x:Name="LayoutRoot" Background="#FF1FB0DB"> 
     <Grid.RowDefinitions> 
      <RowDefinition Height="Auto"/> 
      <RowDefinition Height="*"/> 
     </Grid.RowDefinitions> 



     <!--ContentPanel - place additional content here--> 

     <ScrollViewer> 
      <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0" Height="1500"> 

       <TextBlock HorizontalAlignment="Left" Margin="1,15,0,85" Width="Auto" Height="Auto" Name="TextBlock1" TextWrapping="Wrap"> 
       <LineBreak /> 
      <Run FontFamily="Segoe WP" FontSize="27" FontWeight="ExtraBlack" TextDecorations="Underline"> 
       Weider 6 pack Training is a perfect exercise for flat stomach. 
       </Run> 
       <LineBreak /> 
      <Run Text="This easy training programme has many advantages." FontSize="27" /> 
      <LineBreak /> 
      <Run Text="1. It's perfect for beginners and for experts" FontWeight="ExtraBlack" TextDecorations="Underline" FontSize="27" /> 
      <Run Text=" – exercises are easy and begin with the basic level, so every beginner can use them but they get more complicated pretty fast so advanced sportsmen can also be interested in them." FontSize="27" /> 
      <LineBreak /> 
      <Run Text="2.It helps not only carve your muscles but also burn fat" FontWeight="ExtraBlack" TextDecorations="Underline" FontSize="27" /> 
      <Run Text=" – during the exercise you not only use your abdominal rectus but you also move your legs and arms. It is also because W6 puts pressure on the number of repetitions. It carves your muscles but also burns fat. You can train W6 for about 40 minutes without taking any breaks – you use up all glycogen in blood and start burning the fat." FontSize="27" /> 
      <LineBreak /> 
      <Run Text="3.It is easy " FontStyle="Normal" FontWeight="ExtraBlack" TextDecorations="Underline" FontSize="27" /> 
      <Run Text="– it is a really easy training set which you can train almost anywhere. All you need is flat ground." FontSize="27" /> 
      <LineBreak /> 
      <Run Text="4.It gives excellent results" FontStyle="Normal" FontWeight="ExtraBlack" TextDecorations="Underline" FontSize="27" /> 
      <Run Text=" – if you want to have a flat stomach W6 is designed just for you. You can see the first effects after just a week and after a whole series it is really impressive." FontSize="27" />" 
      <LineBreak /> 
       </TextBlock> 



      </Grid> 
     </ScrollViewer> 

    </Grid> 


    <!--Sample code showing usage of ApplicationBar--> 
    <!--<phone:PhoneApplicationPage.ApplicationBar> 
     <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True"> 
      <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/> 
      <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/> 
      <shell:ApplicationBar.MenuItems> 
       <shell:ApplicationBarMenuItem Text="MenuItem 1"/> 
       <shell:ApplicationBarMenuItem Text="MenuItem 2"/> 
      </shell:ApplicationBar.MenuItems> 
     </shell:ApplicationBar> 
    </phone:PhoneApplicationPage.ApplicationBar>--> 

</phone:PhoneApplicationPage> 
+0

グリッドから高さを削除します。 RowDefinitionsを外部グリッドに削除するか、別の項目を追加します。 ScrollViewerはGrid.Row内にあるはずです。値は* –

答えて

1

エミュレータのバグコンテンツ。あなたが見ているバウンスは、スクロールビューアのコンテナの終わりを超えて移動しようとするときに起こります。

グリッド内の唯一のアイテムであるため、LayoutRootからRowDefinitionsを削除することでこれを解決できます。

現在のところ、行の高さを「自動」に設定すると、それは必要なだけ大きくなることがあります。これはグリッドスペースに関係なく行われます。 ScrollViewerが占めることができるスペースの量を制限して、コンテンツをスクロールする必要があることがわかっている必要があります。

1

正常に動作するには、ここで変更する必要があることがいくつかあります。まず、ScrollViewerは本当にグリッド内にあるはずです。次に、グリッド上の高さを取り除く。

<!--LayoutRoot is the root grid where all page content is placed--> 
<Grid x:Name="LayoutRoot" Background="#FF1FB0DB"> 
    <Grid.RowDefinitions> 
     <RowDefinition Height="Auto"/> 
     <RowDefinition Height="*"/> 
    </Grid.RowDefinitions> 



    <!--ContentPanel - place additional content here--> 

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

     <TextBlock HorizontalAlignment="Left" Margin="1,15,0,85" Width="Auto" Height="Auto" Name="TextBlock1" 
       TextWrapping="Wrap"> 
     <LineBreak /> 
     <Run FontFamily="Segoe WP" FontSize="27" FontWeight="ExtraBlack" TextDecorations="Underline"> 
      Weider 6 pack Training is a perfect exercise for flat stomach. 
     </Run> 
     <LineBreak /> 
     <Run Text="This easy training programme has many advantages." FontSize="27" /> 
     <LineBreak /> 
     <Run Text="1. It's perfect for beginners and for experts" FontWeight="ExtraBlack" 
      TextDecorations="Underline" FontSize="27" /> 
     <Run 
      Text=" – exercises are easy and begin with the basic level, so every beginner can use them but they get more complicated pretty fast so advanced sportsmen can also be interested in them." FontSize="27" /> 
     <LineBreak /> 
     <Run Text="2.It helps not only carve your muscles but also burn fat" FontWeight="ExtraBlack" 
      TextDecorations="Underline" FontSize="27" /> 
     <Run Text=" – during the exercise you not only use your abdominal rectus but you also move your legs and arms. It is also because W6 puts pressure on the number of repetitions. It carves your muscles but also burns fat. You can train W6 for about 40 minutes without taking any breaks – you use up all glycogen in blood and start burning the fat." FontSize="27" /> 
     <LineBreak /> 
     <Run Text="3.It is easy " FontStyle="Normal" FontWeight="ExtraBlack" TextDecorations="Underline" 
      FontSize="27" /> 
     <Run Text="– it is a really easy training set which you can train almost anywhere. All you need is flat ground." FontSize="27" /> 
     <LineBreak /> 
     <Run Text="4.It gives excellent results" FontStyle="Normal" FontWeight="ExtraBlack" 
      TextDecorations="Underline" FontSize="27" /> 
     <Run Text=" – if you want to have a flat stomach W6 is designed just for you. You can see the first effects after just a week and after a whole series it is really impressive." FontSize="27" /> 
     " 
     <LineBreak /> 
     </TextBlock> 


    </ScrollViewer> 
    </Grid> 

</Grid> 
関連する問題