0

I have implemented AutoCompleteTextView, but in few devices (Mi and Samsung), it doesn't show options when the TextView is at the bottom of the screen.

NOTE: The Fields are dynamic, So I don't have option to move the view a bit above from bottom

Drop Down with Keyboard Same Device when keyboard closed

image 3: check the correct here (Motorola device)

I tried:

  1. AutocompleteTextView suggestion list goes up
  2. Android : autocompletetextview, suggestion list displays above the textview?
  3. AppCompatAutoCompleteTextView
  4. Adding different windowSoftInputMode in Android Manifest

and many other things on StackOverflow, but nothing worked

my code

     <AutoCompleteTextView
                    android:id="@+id/txt_drop_down"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:minHeight="@dimen/_40dp"
                    android:layout_weight="1"
                    android:background="@drawable/et_bottom_border"
                    android:completionThreshold="1"
                    android:gravity="center_vertical|start"
                    android:padding="@dimen/_10dp"
                    tools:text="Hello"
                    android:dropDownHeight="wrap_content"
                    tools:textColor="@android:color/black"
                    android:textAlignment="viewStart"
                    android:textColor="@android:color/white"
                    android:textSize="@dimen/_16sp"
                    tools:textSize="35sp" />

Kishita Variya
  • 810
  • 9
  • 19

1 Answers1

0

set android:dropDownHeight in xml to fixed number (e.g. 150dp). Then you will have fixed dropdown with scrollbar there. Also android:layout_height set to fixed size as well.

  • I tried that. It didn't work. It is device specific. Thanks :) – Kishita Variya Oct 22 '19 at 09:49
  • You can also play with android:dropDownAnchor, android:dropDownHorizontalOffset, android:dropDownVerticalOffset and may be some other attributes. (If there is device specific then there might be no generic fix for all cases, for example as with samsung's camera orienation, which needs separate "if" for it :-( ) – Oleksandr Martynets Oct 22 '19 at 10:01