2013-07-29 164 views
0

我寫了一段代碼來顯示一些輸入框和一個連接按鈕。但是當我輸入值到輸入框時,它隱藏了我的連接按鈕,我試着滾動它反彈回來? 什麼可能是這個問題的根源?windows phone 8 scrollviewer隱藏我的按鈕

<ScrollViewer> 
    <Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}"> 

      <StackPanel Grid.Row="0"> 
       <TextBlock Text="" ></TextBlock> 
       <TextBlock Text="{Binding Path=LocalizedResources.LoginPromptSignInText, Source={StaticResource LocalizedStrings}}" FontSize="30"></TextBlock> 
       <TextBlock Text="" ></TextBlock> 
       <TextBlock Text="{Binding Path=LocalizedResources.UsernameText, Source={StaticResource LocalizedStrings}}" ></TextBlock> 
       <TextBox x:Name="TextBlockUserName" ></TextBox> 
       <TextBlock Text="{Binding Path=LocalizedResources.PasswordText, Source={StaticResource LocalizedStrings}}" ></TextBlock> 
       <StackPanel x:Name="PasswordPanel"/> 
       <CheckBox x:Name="CheckBoxShowPassword" Click="ShowPassword" Content="{Binding Path=LocalizedResources.LoginPromptShowPasswordText, Source={StaticResource LocalizedStrings}}"></CheckBox> 
       <TextBlock Text="{Binding Path=LocalizedResources.LoginPromptDomainText, Source={StaticResource LocalizedStrings}}"></TextBlock> 
       <TextBox x:Name="tbDomain" ></TextBox> 

       <Grid > 
        <Grid.ColumnDefinitions> 
         <ColumnDefinition></ColumnDefinition> 
         <ColumnDefinition></ColumnDefinition> 
        </Grid.ColumnDefinitions> 
        <Button x:Name="ButtonExit" Content="{Binding Path=LocalizedResources.LoginPromptExitButtonText, Source={StaticResource LocalizedStrings}}" Grid.Row="2" Grid.Column="0" ></Button> 
        <Button x:Name="ButtonConnect" Content="{Binding Path=LocalizedResources.LoginPromptConnectButtonText, Source={StaticResource LocalizedStrings}}" Grid.Row="2" Grid.Column="1" ></Button> 
       </Grid> 
      </StackPanel> 
    </Grid> 
    </ScrollViewer> 

enter image description here

回答

0

你可以使用一個列表框,而不是滾動瀏覽器,也可以嘗試調整的ScrollViewer的高度屬性。

0

我會建議使用ApplicationBar作爲按鈕。鍵盤顯示在ApplicationBar上方,因此按鈕將始終可見。

<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}"> 
    <ScrollViewer> 
      <StackPanel> 
       <TextBlock Text="" ></TextBlock> 
       <TextBlock Text="Sign In" FontSize="30"/> 
       <TextBlock Text="" ></TextBlock> 
       <TextBlock Text="Username" /> 
       <TextBox x:Name="TextBlockUserName" /> 
       <TextBlock Text="Password" TextTrimming="WordEllipsis" /> 
       <TextBox x:Name="TextBlockPassword" /> 
       <StackPanel x:Name="PasswordPanel"/> 
       <CheckBox x:Name="CheckBoxShowPassword" Content="ShowPassword"></CheckBox> 
       <TextBlock Text="Domain"/> 
       <TextBox x:Name="tbDomain"/> 
      </StackPanel> 
    </ScrollViewer> 
</Grid> 
<phone:PhoneApplicationPage.ApplicationBar> 
    <shell:ApplicationBar> 
     <shell:ApplicationBarIconButton Text="connect" IconUri="Assets\done.png" Click="OnConnectButtonClick"/> 
     <shell:ApplicationBarIconButton Text="cancel" IconUri="Assets\cancel.png" Click="OnCancelButtonClick"/> 
    </shell:ApplicationBar> 
</phone:PhoneApplicationPage.ApplicationBar>