2011-09-23 14 views
11

मैं wp7 में पृष्ठ के माध्यम से स्क्रॉल करने में सक्षम नहीं हूं। घटनाक्रम मैंने स्क्रॉलव्यू जोड़ा है जो अभी भी काम नहीं करता है।विंडोज फोन 7 स्क्रॉलव्यूयर समस्या

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

स्क्रीन स्वचालित रूप से उसके पिछले स्थान पर वापस चला जाता है और स्क्रॉल पूरा नहीं हुआ है। यह सिर्फ नीचे ले जाता है और फिर से वापस एक लोचदार

+0

+1 Xaml और समस्या विवरण की आपूर्ति के लिए +1। –

+0

लेआउट के लिए मार्जिन प्रॉपर्टी का उपयोग करना बहुत लचीला नहीं है, केवल सही होने के लिए बहुत सारे काम की आवश्यकता है, और इसे बदलाव करना वाकई मुश्किल है। आपको लेआउट के लिए स्टैकपैनल जैसे अन्य लेआउट पैनलों पर विचार करना चाहिए। –

+0

यहां तक ​​कि मैं बटनों जैसे छवियों को प्रदर्शित करने के लिए ऐप में अगले पृष्ठ के लिए स्टैकपनेल का उपयोग करने के बारे में सोच रहा हूं <छवि रूपांतरण> –

उत्तर

10

आपका Grid तरह से, कि ScrollViewer की इकलौती संतान है, यही कारण है कि अधिक से अधिक क्षेत्र है कि/नीचे ScrollViewer द्वारा स्क्रॉल किया जा सकता है निर्धारित करता है 1768 की एक निश्चित ऊंचाई है।

आपका ScrollViewer डिफ़ॉल्ट रूप से अपने माता-पिता को फिट करने के लिए फैलता है। वह माता-पिता एक और Grid है जिसमें 1768 की निश्चित ऊंचाई भी है।

इसलिए स्क्रॉल व्यूअर की 1768 की निश्चित ऊंचाई भी है, इसलिए स्क्रॉल करने के लिए कुछ भी नहीं है। स्क्रॉल के लिए उपलब्ध राशि ScrollViewer ऊंचाई और सामग्री ऊंचाई के बीच अंतर है। इस मामले में अंतर 0.

बाहरी ग्रिड की निश्चित ऊंचाई को हटाएं। मुझे संदेह है कि आपके विंडोज फोन में 1768 उच्च स्क्रीन है :)

+0

धन्यवाद ... हालांकि मैं इतना मूर्ख हूं: पी –

+1

जैसा कि आपका उपयोगकर्ता नाम "शिक्षार्थी ..." है आप जाओ :) –