在页面20中需要放置控件。因此我采用了scrollviewer并将网格放置在该scrollviewer.inside网格中放置了所有控件。在运行应用程序时控件是向上和向下滚动但我无法输入文本在页面的下方控件中因为它向上滚动而无法保持稳定以输入下面的控件text.it突然停止所有控件....
<ScrollViewer>
<Grid Name="grid1">
<Image Height="944" HorizontalAlignment="Left" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="486" Source="/MyBuddies;component/Images/registerbg.png" Margin="0,1,0,0" />
<TextBlock Height="51" Margin="127,17,0,0" Name="textBlock1" Text="Registration" VerticalAlignment="Top" FontSize="32" HorizontalAlignment="Left" Width="211" FontFamily="Verdana" TextAlignment="Center" />
<TextBlock Height="51" HorizontalAlignment="Left" Margin="6,83,0,0" Name="textBlock2" Text="First Name" VerticalAlignment="Top" Width="202" FontSize="24" />
<my:WatermarkTextBox Height="71" HorizontalAlignment="Left" Margin="179,68,0,0" Name="watermarkTextBox2" Text="" VerticalAlignment="Top" Width="287" FontSize="24" WatermarkText="Enter Firstname" BorderBrush="#BF000000"/>
<TextBlock FontSize="24" Height="51" HorizontalAlignment="Left" Margin="6,144,0,0" Name="textBlock3" Text="Last Name" VerticalAlignment="Top" Width="202" />
<my:WatermarkTextBox BorderBrush="#BF000000" FontSize="24" Height="71" HorizontalAlignment="Left" Margin="181,130,0,0" Name="watermarkTextBox1" Text="" VerticalAlignment="Top" WatermarkText="Enter Lastname" Width="285" />
<TextBlock FontSize="24" Height="51" HorizontalAlignment="Left" Margin="6,206,0,0" Name="textBlock4" Text="User Name" VerticalAlignment="Top" Width="202" />
<my:WatermarkTextBox BorderBrush="#BF000000" FontSize="24" Height="71" HorizontalAlignment="Left" Margin="181,193,0,0" Name="watermarkTextBox3" Text="" VerticalAlignment="Top" WatermarkText="Enter UserName" Width="286" />
<TextBlock FontSize="24" Height="51" HorizontalAlignment="Left" Margin="6,270,0,0" Name="textBlock5" Text="Password" VerticalAlignment="Top" Width="202" />
<PasswordBox Height="72" HorizontalAlignment="Left" Margin="183,259,0,0" Name="passwordBox1" VerticalAlignment="Top" Width="284" BorderBrush="#BF000000" />
<TextBlock FontSize="24" Height="51" HorizontalAlignment="Left" Margin="6,339,0,0" Name="textBlock6" Text="Confirm Password" VerticalAlignment="Top" Width="202" />
<PasswordBox BorderBrush="#BF000000" Height="72" HorizontalAlignment="Left" Margin="184,324,0,0" Name="passwordBox2" VerticalAlignment="Top" Width="283" />
<TextBlock FontSize="24" Height="51" HorizontalAlignment="Left" Margin="7,406,0,0" Name="textBlock7" Text="Email" VerticalAlignment="Top" Width="202" />
<my:WatermarkTextBox BorderBrush="#BF000000" FontSize="24" Height="71" HorizontalAlignment="Left" Margin="187,389,0,0" Name="watermarkTextBox4" Text="" VerticalAlignment="Top" WatermarkText="Enter Email" Width="281" />
<TextBlock FontSize="24" Height="51" HorizontalAlignment="Left" Margin="6,473,0,0" Name="textBlock8" Text="Gender" VerticalAlignment="Top" Width="202" />
<RadioButton Content="Male" Height="72" HorizontalAlignment="Left" Margin="191,453,0,0" Name="radioButton1" VerticalAlignment="Top" Width="133" />
<RadioButton Content="Female" Height="72" HorizontalAlignment="Left" Margin="317,453,0,0" Name="radioButton2" VerticalAlignment="Top" Width="138" />
<TextBlock FontSize="24" Height="51" HorizontalAlignment="Left" Margin="6,530,0,0" Name="textBlock9" Text="Age" VerticalAlignment="Top" Width="202" />
<my:WatermarkTextBox BorderBrush="#BF000000" FontSize="24" Height="71" HorizontalAlignment="Left" Margin="185,510,0,0" Name="watermarkTextBox5" Text="" VerticalAlignment="Top" WatermarkText="Enter Age" Width="283" />
<TextBlock FontSize="24" Height="51" HorizontalAlignment="Left" Margin="7,587,0,0" Name="textBlock10" Text="City" VerticalAlignment="Top" Width="202" />
<my:WatermarkTextBox BorderBrush="#BF000000" FontSize="24" Height="71" HorizontalAlignment="Left" Margin="187,576,0,0" Name="watermarkTextBox6" Text="" VerticalAlignment="Top" WatermarkText="Enter City" Width="280" />
<TextBlock FontSize="24" Height="51" HorizontalAlignment="Left" Margin="7,658,0,0" Name="textBlock11" Text="Country" VerticalAlignment="Top" Width="202" />
<my:WatermarkTextBox BorderBrush="#BF000000" FontSize="24" Height="71" HorizontalAlignment="Left" Margin="187,641,0,0" Name="watermarkTextBox7" Text="" VerticalAlignment="Top" WatermarkText="Enter Country" Width="280" />
<TextBlock FontSize="24" Height="51" HorizontalAlignment="Left" Margin="6,727,0,0" Name="textBlock12" Text="User Image" VerticalAlignment="Top" Width="202" />
<Image Height="83" HorizontalAlignment="Left" Margin="194,716,0,0" Name="image2" Stretch="Fill" VerticalAlignment="Top" Width="266" Source="/MyBuddies;component/Images/registerphoto.png" />
<TextBlock FontSize="24" Height="51" HorizontalAlignment="Left" Margin="6,861,0,0" Name="textBlock13" Text="User Image" VerticalAlignment="Top" Width="202" />
<my:WatermarkTextBox BorderBrush="#BF000000" FontSize="24" Height="71" HorizontalAlignment="Left" Margin="181,852,0,0" Name="watermarkTextBox8" Text="" VerticalAlignment="Top" WatermarkText="Enter Country" Width="280" />
</Grid>
</ScrollViewer>
答案 0 :(得分:0)
请仔细阅读这个例子,我们必须做一些手动工作,因为这个问题是因为wp7中键盘的默认属性
http://sorokoletov.com/2011/08/windows-phone-70-handling-text-entry-screens/