2011-09-23 4 views
11

Je ne suis pas en mesure de faire défiler la page dans wp7. Même si j'ai ajouté scrollview, ça ne marche toujours pas.Téléphone Windows 7 problème scrollviewer

<phone:PhoneApplicationPage 
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" d:DesignWidth="480" d:DesignHeight="860" 
x:Class="sastadeal.PhonePage1" 
FontFamily="{StaticResource PhoneFontFamilyNormal}" 
FontSize="{StaticResource PhoneFontSizeNormal}" 
Foreground="{StaticResource PhoneForegroundBrush}" 
Orientation="Portrait" 
shell:SystemTray.IsVisible="True" Height="1768"> 

<!--LayoutRoot is the root grid where all page content is placed--> 
<Grid x:Name="LayoutRoot" Background="Transparent" Height="1768"> 
    <ScrollViewer> 

     <!--TitlePanel contains the name of the application and page title--> 
<!--TitlePanel contains the name of the application and page title--> 

    <Grid x:Name="ContentPanel" Margin="24,8,0,-8" Background="#FF61B1DE" Height="1768" > 

     <Image Height="76" Margin="8,8,0,0" Source="logo.png" Stretch="Fill" VerticalAlignment="Top"/> 

     <TextBlock HorizontalAlignment="Left" Margin="35,124,0,0" TextWrapping="Wrap" Text="Account Purpose" VerticalAlignment="Top" Foreground="Black"/> 
     <ListBox x:Name="lb" Height="70" Margin="36,161,185,0" VerticalAlignment="Top" FontSize="24" Background="#FF00BEEF"> 
      <ListBoxItem x:Name="lb_vendor" Content="Launch &amp; Grab Deals"/> 
      <ListBoxItem x:Name="lb_customer" Content="Grab Deals"/> 
     </ListBox> 
     <TextBlock HorizontalAlignment="Left" Margin="32,252,0,0" TextWrapping="Wrap" Text="Enter You Vendor Code" Foreground="Black" VerticalAlignment="Top" Name="Vendorcode_tb"/> 
     <TextBox x:Name="vendorcode_text" HorizontalAlignment="Left" Margin="21,283,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="334" /> 
     <TextBlock HorizontalAlignment="Left" Margin="35,363,0,0" TextWrapping="Wrap" Text="e-Mail ID-" Foreground="Black" VerticalAlignment="Top"/> 
     <TextBox HorizontalAlignment="Left" Margin="21,390,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="334"/> 
     <TextBlock HorizontalAlignment="Left" Margin="32,466,0,0" TextWrapping="Wrap" Text="Enter Password - " Foreground="Black" VerticalAlignment="Top"/> 
     <TextBox x:Name="pwd" HorizontalAlignment="Left" Margin="21,497,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="335"/> 
     <TextBox x:Name="pwdr" HorizontalAlignment="Left" Margin="21,596,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="335"/> 
     <TextBlock HorizontalAlignment="Left" Margin="32,569,0,0" TextWrapping="Wrap" Text="Re-enter password" Foreground="Black" VerticalAlignment="Top"/> 
     <TextBlock HorizontalAlignment="Left" Margin="35,669,0,0" TextWrapping="Wrap" Text="Contact Number -" VerticalAlignment="Top" Foreground="Black"/> 
     <TextBox x:Name="Cno_txt" HorizontalAlignment="Left" Margin="21,700,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="335" InputScope="Number"/> 
     <TextBlock HorizontalAlignment="Left" Margin="36,776,0,0" TextWrapping="Wrap" Text="Mobile Number- " Foreground="Black" VerticalAlignment="Top"/> 
     <TextBox x:Name="mno_text" HorizontalAlignment="Left" Margin="21,807,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="335"/> 
     <TextBlock HorizontalAlignment="Left" Margin="30,898,0,0" TextWrapping="Wrap" Text="Address 1" Foreground="Black" VerticalAlignment="Top"/> 
     <TextBox HorizontalAlignment="Left" Margin="36,950,0,0" TextWrapping="Wrap" Text="" x:Name="add1_text" Width="335" InputScope="PostalAddress" Height="72" VerticalAlignment="Top"/> 
     <TextBlock HorizontalAlignment="Left" Margin="36,1026,0,0" TextWrapping="Wrap" Text="Address 2" Foreground="Black" VerticalAlignment="Top"/> 
     <TextBox HorizontalAlignment="Left" Margin="36,1057,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="335"/> 

    </Grid> 
    </ScrollViewer> 
</Grid> 

L'écran passe automatiquement à son emplacement précédent et le défilement n'est pas complète. Il vient se déplace vers le bas et que de nouveau comme un élastique

+0

+1 pour fournir Xaml ainsi que la description du problème. –

+0

L'utilisation de la propriété Margin pour la mise en page n'est pas très flexible, nécessite beaucoup de travail pour obtenir les résultats escomptés et rend la modification très difficile. Vous devriez considérer les autres panneaux de disposition tels que StackPanel pour la mise en page. –

+0

même je pense à utiliser stackpanel pour la page suivante dans l'application pour afficher les tuiles comme les boutons

Répondre

10

Votre Grid, qui est le seul enfant du ScrollViewer, a une hauteur de 1768. fixe qui détermine la superficie maximale qui peut être défiler vers le haut/vers le bas par le ScrollViewer.

Votre ScrollViewer s'étire pour s'adapter à son parent par défaut. Ce parent est un autre Grid qui a également une hauteur fixe de 1768.

Par conséquent, le ScrollViewer a également une hauteur fixe de 1768. Il n'y a donc rien à faire défiler. Le montant disponible pour faire défiler la lecture est la différence entre la hauteur de ScrollViewer et la hauteur du contenu. Dans ce cas, la différence est 0.

Supprimer la hauteur fixe de la grille externe. Je doute que votre Windows Phone a un 1768 écran élevé :)

+0

Merci ... im un tel fou cependant: p –

+1

Comme votre nom d'utilisateur est "apprenant ..." nous devons laisser toi dehors :) –

Questions connexes