EditText, inputType values (XML) - Stack Overflow
文章推薦指數: 80 %
Set inputType for an EditText Programmatically ... Home Public Questions Tags Users Collectives ExploreCollectives FindaJob Jobs Companies Teams StackOverflowforTeams –Collaborateandshareknowledgewithaprivategroup. CreateafreeTeam WhatisTeams? Teams CreatefreeTeam CollectivesonStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. Learnmore Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. Learnmore EditText,inputTypevalues(XML) AskQuestion Asked 11years,7monthsago Active 7monthsago Viewed 178ktimes 134 54 WherecanIfindthevaluesthatInputTypecanhas? I'mawareofhttp://developer.android.com/reference/android/text/InputType.html,buthowshouldthevalueslooklikeinlayoutXMLfiles? androidlayoutandroid-edittextandroid-inputtype Share Improvethisquestion Follow editedApr1at19:53 Syscall 17.2k99goldbadges2525silverbadges4444bronzebadges askedApr26'10at10:43 jgauffinjgauffin 96.6k4141goldbadges229229silverbadges355355bronzebadges 3 2 Abitlateintheday,butIthinkthismightbewhatyou'relookingfor:developer.android.com/reference/android/R.attr.html – ChrisV Jun23'10at21:01 3 Thismaybewhatyou'relookngfor:developer.android.com/reference/android/… – RobbieMatthews Aug19'11at14:36 1 Specificallydeveloper.android.com/reference/android/R.attr.html#inputType – cottonBallPaws Feb12'13at17:02 Addacomment | 3Answers 3 Active Oldest Votes 313 Youcanusethepropertiestabineclipsetosetvariousvalues. hereareallthepossiblevalues none text textCapCharacters textCapWords textCapSentences textAutoCorrect textAutoComplete textMultiLine textImeMultiLine textNoSuggestions textUri textEmailAddress textEmailSubject textShortMessage textLongMessage textPersonName textPostalAddress textPassword textVisiblePassword textWebEditText textFilter textPhonetic textWebEmailAddress textWebPassword number numberSigned numberDecimal numberPassword phone datetime date time Checkhereforexplanations:http://developer.android.com/reference/android/widget/TextView.html#attr_android:inputType Share Improvethisanswer Follow editedMay22'14at19:51 DheerajBhaskar 17.6k99goldbadges5959silverbadges6565bronzebadges answeredApr26'10at11:11 RaviVyasRaviVyas 11.9k66goldbadges2929silverbadges4545bronzebadges 2 53 developer.android.com/reference/android/widget/… – Josh Jun15'11at14:35 Description...? – YoushaAleayoub Sep12'16at17:24 Addacomment | 31 Supplementalanswer Hereishowthestandardkeyboardbehavesforeachoftheseinputtypes. Seethisanswerformoredetails. Share Improvethisanswer Follow answeredApr3'18at4:04 SuragchSuragch 397k256256goldbadges12291229silverbadges12661266bronzebadges 1 Perfectexamplewithvidoeabouthowyourkeyboardlooklikeafterusinginputtype – Ashish Sep10'20at5:08 Addacomment | 0 android:inputMethod isdeprecated,insteaduseinputType: android:inputType="numberPassword" Share Improvethisanswer Follow editedJan2'20at20:56 dsh 11.5k33goldbadges2828silverbadges4949bronzebadges answeredFeb19'19at18:34 HamedJalilianiHamedJaliliani 2,4572020silverbadges2929bronzebadges Addacomment | YourAnswer ThanksforcontributingananswertoStackOverflow!Pleasebesuretoanswerthequestion.Providedetailsandshareyourresearch!Butavoid…Askingforhelp,clarification,orrespondingtootheranswers.Makingstatementsbasedonopinion;backthemupwithreferencesorpersonalexperience.Tolearnmore,seeourtipsonwritinggreatanswers. Draftsaved Draftdiscarded Signuporlogin SignupusingGoogle SignupusingFacebook SignupusingEmailandPassword Submit Postasaguest Name Email Required,butnevershown PostYourAnswer Discard Byclicking“PostYourAnswer”,youagreetoourtermsofservice,privacypolicyandcookiepolicy Nottheansweryou'relookingfor?Browseotherquestionstaggedandroidlayoutandroid-edittextandroid-inputtypeoraskyourownquestion. TheOverflowBlog Whoownsthisoutage?BuildingintelligentescalationchainsformodernSRE Podcast395:Whoisbuildingcloudsfortheindependentdeveloper? FeaturedonMeta Nowlive:Afullyresponsiveprofile Reducingtheweightofourfooter TwoBornottwoB-Farewell,BoltClockandBhargav! Linked 238 SetinputTypeforanEditTextProgrammatically? 18 Enableemailkeyboardonandroidforinputtypeemail 2 textViewwontdisplaydecimals 2 activatepasswordkeyboardonandroidinhtmlinputfield 0 error:ErrorparsingXML:notwell-formed(invalidtoken)? -1 Changefromnumberkeypadtogeneralkeypad Related 2772 HowcanIsaveanactivitystateusingthesaveinstancestate? 4135 Howdoyouclose/hidetheAndroidsoftkeyboardprogrammatically? 3058 HowtostopEditTextfromgainingfocusatActivitystartupinAndroid 1220 Isquittinganapplicationfrownedupon? 1092 HowtomakelinksinaTextViewclickable 793 HowtodefineacircleshapeinanAndroidXMLdrawablefile? 412 FirstlettercapitalizationforEditText 567 HowtohideunderbarinEditText 1128 YouneedtouseaTheme.AppCompattheme(ordescendant)withthisactivity HotNetworkQuestions HowcanIgettrue1"thickoakboards? Sci-fistorywherepeoplearereincarnatedathubsandamanwantstofigureoutwhatishappening SinglechippowergoodIC? Does来mean"bring"? IstheDaoathingoranaction? Projectingshadows,orevenamovie,onthemoon WhataretheoptionsforaPCwithcoldresistanceanddarkvision? Couldanyequationhavepredictedtheresultsofthissimulation? NewtoBikes:MychainfelloffandIputitbackon.HowcanIknowifit'sontherightcog? ipv6prefixinterpretation Doesthe1xoscilloscopeprobesettingslowdownMhzdigitalsignals? Howcananoceanofseawaterbehavelikehoneywithoutchangingthechemistry? Where(inGermany)isthelandscapebehindthisnewsreader,withagazeboonasmall,lushsteephillsurroundedbyhigher,broaderforestedhills? IbrokemyGstringandmyother3stringsareoutoftunetoo WhatshouldIdoideallytorechargeduringaPhD? HowcanInotgetunfairlyblamedforthingsbymyboss? IsitlegalintheUStoleaveaguninthehandsofaminorwithoutoversight? HowcanIfitaglasscooktophoodintoaspacethat'stootight? WhatCouldExplainASolitaryMountaininaGrassland? WhydidAtarifloppiesrunat288RPM? Whatdoesitmeantograntachurchtoapriory? Youngadulttime-travellingbookwiththetag-line"whatifyoucouldslipinandoutoftime" Whymaximumaposterior,notmaximumposterior? Whatpotentialdifferenceorcurrentwouldkillaperson? morehotquestions Questionfeed SubscribetoRSS Questionfeed TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader. default Yourprivacy Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy. Acceptallcookies Customizesettings
延伸文章資訊
- 1《Android》『EditText』- EditText 的基本用法 - 賽肥膩膩の ...
與Button 一樣,EditText 類別繼承自TextView 類別,也因此EditText 類別中的很多方法均繼承自TextView,用法完全一致,以下主要說明一些EditText 的基本用法。
- 2android EditText inputType详解 - 简书
这是一篇关于Android EditText中的inputType详解,因为Android中inputType属性在EditText输入值时启动的虚拟键盘的风格有着重要的作用...
- 3一起幫忙解決難題,拯救IT 人的一天
[Day 07] 我的第一個Android程式- BMI程式設計(二) 簡介EditText的inputType. [Andriod] Andriod Studio 從入門到進入狀況系列第8 篇.
- 4Android 中EditText 的inputType 属性及其他常用属性详解
一、xml里面调用:<---输入数字->android:inputType="number"/> 二、Activity里的调用:EditText editText=(EditText)findV...
- 5Android edittext 属性inputtype详解 - CSDN博客
上个星期看公司一个项目中灵活用到edittext 属性inputtype。inputtype属性不仅可以再xml里面定义。还可以在activity设置的。项目应用场景是这样。