Skip to main content

AutoCompleteTextInput

این المان مشابه با المان textInput است با این تفاوت که شما می توانید لیستی از پیشنهادات یا suggestion وارد کنید و در هنگام نوشتن حروفی از آن کلمه ، آن کلمه به کاربر پیشنهاد شود. متن پیشنهادی به صورت آرایه در اتریبیوت suggestion قرار میگیرد.

در ادامه یک نمونه کد از AutoCompleteTextInput را مشاهده می کنید:

<page title="اپسان" background="#DDDDDD" toolbarColor="#E64724" width="match_parent" height="match_parent" >
	<frame margin="center" width="wrap_content" height="770">
        <autocompletetextinput 
                       id="in" suggestions="[&quot;tehran&quot;,&quot;karaj&quot;,&quot;tabriz&quot;]">
		</autocompletetextinput>
    </frame>
</page>

آرایه شما باید escape شده باشد مثلا آرایه [ "a" , "b" , "c" ] به صورت زیر باید نوشته شود:

[&quot;a&quot;,&quot;b&quot;,&quot;c&quot;]

اجرای کد فوق به شکل زیر است :

 

photo_2021-07-17_23-56-11.jpg