Windows phone 7 keyboard size

删除回忆录丶 提交于 2019-12-02 02:23:31

问题


I want to resize the page when the keyboard appears on the screen.

I was looking for any clue all day but I can't find anything.

In my case. I want to have full page TextBox and some buttons under it.

<Grid x:Name="RootLayout" >

    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="70"/>
        </Grid.RowDefinitions>

        <ScrollViewer Margin="0" >
            <TextBox TextWrapping="Wrap" Text="TextBox" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" Height="698" Width="480"/>
        </ScrollViewer>

        <Canvas x:Name="RootMenu" Margin="0,1,0,0" Grid.Row="1" />
    </Grid>

</Grid>

I use to thing that the first row will change its size automatically, but it doesn't happening.

Please help me.

///// -----------------------------------------------------------------------------

I'm going to dislike this OS! Proposed solution is not good at all. When the keyboard is visible then I can not scroll it down.

Lets say I want just simple TextBox to let users write something. But it is impossible !!

<phone:PhoneApplicationPage.ApplicationBar>
    <shell:ApplicationBar IsVisible="True">
        <shell:ApplicationBarIconButton IconUri="/icons/appbar.check.rest.png" Text="aplay"/>
    </shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>

<Grid x:Name="RootLayout" >
    <ScrollViewer>
        <TextBox  Text="TextBox" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" />
    </ScrollViewer>
</Grid>

回答1:


There isn't a way to know for sure if the SIP is displayed. Jaime Rodriguez has a post showing how to make a fairly reliable guess of this.

If you want to have "buttons" that are always displayed then the best, and only reliable, way to do this is to use the ApplicationBar.



来源:https://stackoverflow.com/questions/4399153/windows-phone-7-keyboard-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!