AutoCompleteTextInput
این المان مشابه با المان textInput است با این تفاوت که شما می توانید لیستی از پیشنهادات یا suggestion وارد کنید و در هنگام نوشتن حروفی از آن کلمه ، آن کلمه به کاربر پیشنهاد شود
متن پیشنهادی به صورت آرایه در اتریبیوت suggestion قرار میگیرد.
در ادامه یک نمونه کد از AutoCompleteTextInput را مشاهده می کنید:
<page title="AutoCompleteTextInput" background="#FFFFFF" toolbarColor="#E64724" width="match_parent" height="match_parent">
<image src="http://162.55.105.137:8080/api/public/dl/a4Y26e4j" width="25" height="25" margin_left="-160" margin_top="50"></image>
<text text="university:" textsize="17" textcolor="#E64724" margin_left="50" margin_top="-30"></text>
<autocompletetextinput
hint=id="لطفا نام دانشگاه خود را وارد کنید" width="match_parent"
height="wrap_content" margin_top="35"in" suggestions="شهید بهشتی"["test1","t2","t3"]">
</autocompletetextinput>
</page>
آرایه شما باید escape شده باشد مثلا آرایه [ "a" , "b" , "c" ] به صورت زیر باید نوشته شود:
["a","b","c"]
اجرای کد فوق به شکل زیر است :
