Setting up EditText with “url” inputType

让人想犯罪 __ 提交于 2019-11-29 11:31:51

问题


I am trying to make an EditText such that when i click it a key board containing ".com" appears because a url is to be intered into the EditText. I tried to use this: android:inputType="textUri" but it is not working. How do i do it?


回答1:


try this one

<EditText 
        android:id="@+id/edt"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:inputType="textWebEmailAddress"
        />

android:inputType="textWebEmailAddress" use this property for that.




回答2:


You can use inputType as textWebEmailAddress or textEmailAddress. Specs say it is device dependent but honestly I did not find any difference. Purpose of using this is you can use the @ and .com keys in the keypad. I tried both on samsung Galaxy S5 and keypad is the same.



来源:https://stackoverflow.com/questions/21954503/setting-up-edittext-with-url-inputtype

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!