Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cause for a clipped keyboard in landscape

I have a page with a Pivot, with TextBox controls. In landscape, the SIP (the virtual keyboard) is opffsetted right by 42 pixels, thus clipped to its right.

Clipped keyboard in landscape

Another app of mine also has a similar page, without the offsetted keyboard problem. Before I dig more into the differences between the two, has anyone ever encountered this problem before? Can we consider this a bug with Windows Phone 7.1?

(it does occur on a real device too)

like image 717
Martin Plante Avatar asked Nov 04 '22 17:11

Martin Plante


1 Answers

It is a bug in windows phone:

If you set the Mode property on the app bar to Minimised and then turn the thing to landscape, the app bar pops back out. The code that figures out where to show the keyboard doesn't realise this and displays the keyboard as if the app bar is still minimised.

I solved it by changing the mode of the app bar as the orientation changes:

private void phoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
{
  if (e.Orientation == PageOrientation.LandscapeLeft || e.Orientation == PageOrientation.LandscapeRight)
  {
    this.ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
  }
  else
  {
    this.ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Minimized;
  }
}

This seems to solve the problem

like image 126
Ed Ayers Avatar answered Nov 13 '22 02:11

Ed Ayers