android keyboard blocking EditText

2019-05-25 21:29发布

After an EditText control gets focus, the soft keyboard displays, if the control is below half of the screen, the keyboard will block it from allowing user to input.

I did some search, adding windowSoftInputMode (both tried adjustPan and adjustResize) for the activity in the AndroidManifest.xml file will solve the blocking issue, but all input controls look awful, e.g., the single line text will have gray background and black border, and radio button will have dark thick border and green inside, and the focused multi line EditBox will have complete black background.

Any idea how to solve the issue (not blocking input and without those awful controls.)

  1. "Theme.Holo.Light.NoActionBar" as default theme.
  2. Android 4.1.x

1条回答
倾城 Initia
2楼-- · 2019-05-25 22:08

Try using the following line in your manifest inside the activity tag. It will work.

<activity
    android:name="Your activity name"
    android:windowSoftInputMode="adjustPan"/>

Even then if any problem, you can use scrollview along with this.

查看更多
登录 后发表回答