0

For my app, when I enter text into the text field and then turn the screen sideways, the entire view turns white. Here are some images to show it:

9:16 aspect ratio, vertical:

enter image description here

16:9 aspect ratio, horizontal:

enter image description here

Is this an easy fix or is there serious time commitment in order to make this word properly for landscape orientation as well?

Michael Yaworski
  • 13,410
  • 19
  • 69
  • 97

5 Answers5

2

put android:imeOptions="flagNoExtractUi" in the EditText XML properties

0

That's actually the way the keyboard works when you input text in landscape. I don't think there's any other way to change or get rid of the white background, but the TextView should still work the same.

Michael Yaworski
  • 13,410
  • 19
  • 69
  • 97
TheWizKid95
  • 721
  • 6
  • 16
0

See this post, you can try to override the UI full screen editing method with:

@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {

    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI;

    // etc.
}
Community
  • 1
  • 1
Nick
  • 9,285
  • 33
  • 104
  • 147
  • I just get an error when I put that. It tells me to remove the `@Override` statement and then when I do, it tell me that the method needs to `return` something or be cast as `void`, neither of which work. – Michael Yaworski Jul 29 '13 at 21:24
0

When a screen rotation takes place, the current activity is destroyed and recreated. This may be the cause of your issue.

Maybe this SO post will help...

https://stackoverflow.com/a/1673374/1246574

Also here's the documentation that gives details about how to handle activity life cycle, including when an activity is destroyed due to screen rotation...

http://developer.android.com/training/basics/activity-lifecycle/recreating.html

Community
  • 1
  • 1
Jim
  • 6,753
  • 12
  • 44
  • 72
0

In Themes.xml create a separate style

<style name="Theme.AppName.NoActionBar">
       <item name="android:theme"> @style/Theme.AppCompat.Light</item>
</style>

And AndroidManifest

android:theme="@style/Theme.AppName.NoActionBar" 
Dhaval Solanki
  • 4,589
  • 1
  • 23
  • 39