0

I tried to align the text inside my edit text right but I don't want to use gravity as gravity property (I don't know why) hiding my edit text when softkeypad appears. So, is there any alternative to gravity and of course layout gravity property for edit text?

  • possible duplicate of [Android soft keyboard covers edittext field](http://stackoverflow.com/questions/3295672/android-soft-keyboard-covers-edittext-field) – Yevgeny Simkin Jun 17 '15 at 18:52

2 Answers2

0

If you're using a Horizontal Linear Layout, you can try adding:

<View
   android:layout_width="0dp"
   android:layout_height="0dp"
   android:layout_weight="1"/>

just before the edittext.

TheScarecrow
  • 153
  • 9
0

Sounds to me like your problem is that you don't want the keyboard to cover your EditText. I would leave the gravity alone (since that's the correct way to align the text inside the field) and consult this answer on how to protect from having the keyboard obstruct your field.

Community
  • 1
  • 1
Yevgeny Simkin
  • 27,946
  • 39
  • 137
  • 236