2012-04-05 10 views
0

Ich kann nicht in WP7 scrollen. Ich habe mehr Blöcke außerhalb des Emulatorbildschirms, aber ich kann nicht scrollen. irgendwelche Ideen? Ich bin Neuling in der visuellen, nur versuchen, zu lernen, so bitte erklären, wo soll ich Code kopieren :)Bildlaufleiste in WP7

x:Class="Fitness_excercises.MainPage" 
     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" 
     mc:Ignorable="d" FontFamily="{StaticResource PhoneFontFamilyNormal}" 
     FontSize="{StaticResource PhoneFontSizeNormal}" 
     Foreground="{StaticResource PhoneForegroundBrush}" 
     SupportedOrientations="Portrait" Orientation="Portrait" 
     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="Transparent" Height="976" Width="480"> 
    <Grid.RowDefinitions> 
     <RowDefinition Height="Auto"/> 
     <RowDefinition Height="904*" /> 
    </Grid.RowDefinitions> 

    <!--TitlePanel contains the name of the application and page title--> 
    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"> 
     <TextBlock x:Name="ApplicationTitle" Text="Fitness excercises" Style="{StaticResource PhoneTextNormalStyle}"/> 
    </StackPanel> 

    <!--ContentPanel - place additional content here--> 
    <Grid x:Name="ContentPanel" Margin="12,52,12,-3" Grid.RowSpan="2"> 
     <Button Content="Weider's six" Height="72" HorizontalAlignment="Center" Margin="-12,52,46,0" Name="button1" VerticalAlignment="Top" Width="422" /> 
     <Button Content="Waist Slimming Exercises" Height="72" HorizontalAlignment="Left" Margin="-12,104,0,0" Name="button2" VerticalAlignment="Top" Width="422" /> 
     <Button Content="Leg excercises" Height="72" HorizontalAlignment="Left" Margin="-12,157,0,0" Name="button3" VerticalAlignment="Top" Width="422" /> 
     <Button Content="Buttocks excercises" Height="72" HorizontalAlignment="Left" Margin="-12,209,0,0" Name="button4" VerticalAlignment="Top" Width="422" /> 
     <Button Content="Hand and wrist excercises" Height="72" HorizontalAlignment="Left" Margin="-12,262,0,0" Name="button5" VerticalAlignment="Top" Width="422" /> 
     <Button Content="Warm-up" Height="72" HorizontalAlignment="Left" Margin="-12,0,0,0" Name="button6" VerticalAlignment="Top" Width="422" /> 
     <Button Content="100 push-ups" Height="72" HorizontalAlignment="Left" Margin="-13,576,0,0" Name="button7" VerticalAlignment="Top" Width="422" /> 
     <Button Content="300 crunches" Height="72" HorizontalAlignment="Left" Margin="-12,367,0,0" Name="button8" VerticalAlignment="Top" Width="422" /> 
     <Button Content="Aerobic training" Height="72" HorizontalAlignment="Left" Margin="-12,418,0,0" Name="button9" VerticalAlignment="Top" Width="422" /> 
     <Button Content="50 pull-ups" Height="72" HorizontalAlignment="Left" Margin="-12,469,0,0" Name="button10" VerticalAlignment="Top" Width="422" /> 
     <Button Content="300 squats" Height="72" HorizontalAlignment="Left" Margin="-12,524,0,0" Name="button11" VerticalAlignment="Top" Width="422" /> 
     <Button Content="Chest excercises" Height="72" HorizontalAlignment="Left" Margin="-12,313,0,0" Name="button13" VerticalAlignment="Top" Width="422" /> 
     <Button Content="Diet atlas" Height="82" HorizontalAlignment="Left" Margin="-13,629,0,0" Name="button12" VerticalAlignment="Top" Width="422" /> 
     <Button Content="Button" Height="82" HorizontalAlignment="Left" Margin="-13,693,0,0" Name="button14" VerticalAlignment="Top" Width="422" /> 
     <ScrollViewer Height="716" HorizontalAlignment="Left" Margin="456,0,0,0" Name="ScrollViewer1" VerticalAlignment="Top" Width="0" /> 

    </Grid> 
</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>--> 

Antwort

1

, die einen Teil der Schnittstelle sind Sie wollen blättern haben? Welchen Teil auch immer, Sie sollten dieses Element mit einer <ScrollViewer> umgeben.

Zum Beispiel, wenn Sie die Content Grid Scroll haben wollen, sind, würden Sie so etwas tun:

<ScrollViewer 
    <Grid x:Name="ContentPanel" Margin="12,52,12,-3" Grid.RowSpan="2"> 
    .... 
    </Grid> 
</ScrollViewer> 
+0

Ok, aber wenn ich Maustaste loslassen kommt es wieder normal. Ich habe Tasten vom Bildschirm weg, und wenn ich darauf klicken möchte, kann ich nicht, weil es zurückkommt –

+0

Könnten Sie vielleicht umformulieren? Ich bin mir nicht ganz sicher, welches Problem Sie haben oder was Sie meinen "Ich habe Tasten vom Bildschirm weg" – oltman

+0

In visuellen ich sehe auf meinem Handy-Bildschirm 16 Tasten, die nächsten 3 sind weg vom Bildschirm (unter diesen 16, aber nicht sichtbar), ich muss das Inhaltsfenster nach oben verschieben, um sie zu sehen. Wenn ich im Emulator nach unten scrolle (die Maustaste gedrückt halte), sehe ich die nächsten 3 Knöpfe, aber wenn ich ihn loslasse, kommt er auf diese 16 zurück. Ist es möglich, die Ansicht zu sperren? Ich meine, wenn ich scrolle, bleibt es in der Position, in der ich gescrollt habe. –