Windows Phone 8 scrolling when keyboard visible

2019-08-03 23:38发布

问题:

I've searched loads for an answer to my problem.

Basically on my WP8 app, I have an "add record" page and a list of text boxes. I can scroll up and down the full length of the page fine, but when I tap one of the text boxes and the keyboard appears, I can no longer scroll to the very bottom and therefore can't complete the last couple text boxes.

Now, if you have a look at the MS calendar app on WP8, the "new appointment" page has a similar thing - when you tap one of the text boxes you can still scroll the whole way up and down.

I was wondering, is there anywhere I can see the XAML that MS have used? Then I can learn from that. I'm sure it's as simple as setting a height property or something but I've been stumped on this for a while now.

Rather than posting my XAML etc, does anyone know where I can get a look at the XAML for the MS stock apps? If this is even possible...

Thanks

回答1:

I had the same issue. but at last i solved it, i just used the Height property to do this. i already answered for the same type of problem posted by someone.Please do the following steps

  • First create a ScrollViewer
  • Indide the ScrollViewer create a container(eg: Grid/StackPanel/Border etc...) and put every controlls inside it.
  • Set fixed Height for ScrollViewer and the Container (Note: Height of container should be greater than ScrollViewer's Height)

See the below Code

<ScrollViewer Height="500">
        <Grid Name="Container" Height="700">
            <TextBox/>
            <TextBox/>
            <TextBox/>
        </Grid>
</ScrollViewer>

Now you can scroll the container Grid Even the KeyBoard shown or even focus on a TextBox.