In the following screenshot, I have an image that is followed by a scrollview. The scrollview contains a tablelayout and then some edittext fields, followed by a button
When I want to enter values into my fields, the keyboard pops up and it's blocking my view of the fields, like so:
As you can see, it blocks my view of the edittext fields. Is there an elegant fix for hiding the keyboard? If not, I will change my layout, however I'm not sure what to change. My layout looks like:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#CCCCCC"
android:weightSum="1" android:id="@+id/llid">
<TextView ... >
</TextView>
<!-- Image inserted here as an ImageView from my code -->
<ScrollView
android:id="@+id/svid"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="3dp">
<LinearLayout>
<TableLayout ... >
<TableRow>
<TextView ... />
<TextView ... />
</TableRow>
<TableRow>
<TextView ... />
<TextView ... />
</TableRow>
<TableRow>
<TextView ... />
<TextView ... />
</TableRow>
</TableLayout>
<EditText>
...
</EditText>
<EditText>
...
</EditText>
<EditText>
...
</EditText>
<Button>
...
</Button>
</LinearLayout>
</ScrollView>
</LinearLayout>
My first thought is go to the settings within the emulator:
settings -> language and keyboard and uncheck "Android keyboard" and the other odd ones if they are checked too
Since the emulator is suppose to emulate what would be seen on the phone it makes sense that if you are trying to enter values into a text field the keyboard will pop up. I understand it can be irritating but, you should not try to disable it in your code, because that will disable it on the phone and then how will the user enter their inputs?
Also, you can press the hardware back button to dismiss the keyboard when it pops up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With