1

The default behavior of an Android edittext is that when the user orients in landscape mode, the keyboard fills the screen and the input of the edittext fills the top part, with a "send" or "done" button next to it. All the user can see is the input field with the button. And the background of the input field is invariably white.

I would be fine with that, if I could change the background color or transparency in that mode.

Can I do that and how?

Laurent
  • 1,554
  • 19
  • 42

1 Answers1

0

In Xml file you have to define a tag android:background="#008A00"

in the commas you can define your own colour code which you want. If you want to transparency dynamically than use

button.getBackground().setAlpha(128);  // 50% transparent

Int range is 0-255 0 for fully transperent 255 for fully opaque

In xml also you can define alpha for transparency

android:alpha="0.0" that's invisible
android:alpha="0.5" see-through
android:alpha="1.0" full visible
Piyush
  • 18,895
  • 5
  • 32
  • 63
Harsh Mittal
  • 449
  • 3
  • 10
  • This is not the question though - I know how to set the transaparency of the edittext, it's the opacity of the fullscreen landscape in extract mode (when the user changes orientation to fullscreen, the keyboard takes over the screen and only the input form with a "send"or "done" button remains; in this case the background of the input form is invariably white, and your answer does not address this. – Laurent Jan 31 '15 at 02:35