本文为原创,如需转载,请注明作者和出处,谢谢!
AutoCompleteTextView 和 EditText 组件类似,都可以输入文本。但 AutoCompleteTextView 组件可以和一个字符串数组或 List 对象绑定,当用户输入两个及以上字符时,系统将在 AutoCompleteTextView 组 件下方列出字符串数组中所有以输入字符开头的字符串,这一点和 www.Google.com 的搜索框非常相似,当输入某一个要查找的字符串时, Google 搜索框就会列出以这个字符串开头 的最热门的搜索字符串列表。
AutoCompleteTextView 组件在 XML 布局文件中使用 <AutoCompleteTextView> 标签来表示,该标签的使用方法与 <EditText> 标签相同。如果要让 AutoCompleteTextView 组件显示辅助输入列表,需要使用 AutoCompleteTextView 类的 setAdapter 方法指定一个 Adapter 对象,代码如下:
ArrayAdapter < String > adapter = new ArrayAdapter < String > ( this ,
android.R.layout.simple_dropdown_item_1line,autoString);
AutoCompleteTextViewautoCompleteTextView =
(AutoCompleteTextView)findViewById(R.id.autoCompleteTextView);
autoCompleteTextView.setAdapter(adapter);
<!-- [if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:DoNotShowRevisions /> <w:DoNotPrintRevisions /> <w:DoNotShowMarkup /> <w:DoNotShowComments /> <w:DoNotShowInsertionsAndDeletions /> <w:DoNotShowPropertyChanges /> <w:PunctuationKerning /> <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>ZH-CN</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:SpaceForUL /> <w:BalanceSingleByteDoubleByteWidth /> <w:DoNotLeaveBackslashAlone /> <w:ULTrailSpace /> <w:DoNotExpandShiftReturn /> <w:AdjustLineHeightInTable /> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> <w:UseFELayout /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val="--> <!-- [endif]-->
运行上面代码后,在文本框中输入“手机”, 就会显示如图 1 所 示的效果。
<!-- [if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:DoNotShowRevisions /> <w:DoNotPrintRevisions /> <w:DoNotShowMarkup /> <w:DoNotShowComments /> <w:DoNotShowInsertionsAndDeletions /> <w:DoNotShowPropertyChanges /> <w:PunctuationKerning /> <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>ZH-CN</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:SpaceForUL /> <w:BalanceSingleByteDoubleByteWidth /> <w:DoNotLeaveBackslashAlone /> <w:ULTrailSpace /> <w:DoNotExpandShiftReturn /> <w:AdjustLineHeightInTable /> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> <w:UseFELayout /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val="--> <!-- [endif]--><!-- [if gte mso 9]><xml> <w:LatentStyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"> <w:LsdException locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal" /> <w:LsdException locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 2" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 3" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 4" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 5" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 6" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 7" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 8" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 9" /> <w:LsdException locked="false" priority="39" name="toc 1" /> <w:LsdException locked="false" priority="39" name="toc 2" /> <w:LsdException locked="false" priority="39" name="toc 3" /> <w:LsdException locked="false" priority="39" name="toc 4" /> <w:LsdException locked="false" priority="39" name="toc 5" /> <w:LsdException locked="false" priority="39" name="toc 6" /> <w:LsdException locked="false" priority="39" name="toc 7" /> <w:LsdException locked="false" priority="39" name="toc 8" /> <w:LsdException locked="false" priority="39" name="toc 9" /> <w:LsdException locked="false" priority="35" qformat="true" name="caption" /> <w:LsdException locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title" /> <w:LsdException locked="false" priority="1" name="Default Paragraph Font" /> <w:LsdException locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle" /> <w:LsdException locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong" /> <w:LsdException locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis" /> <w:LsdException locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid" /> <w:LsdException locked="false" unhidewhenused="false" name="Placeholder Text" /> <w:LsdException locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing" /> <w:LsdException locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading" /> <w:LsdException locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List" /> <w:LsdException locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid" /> <w:LsdException locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1" /> <w:LsdException locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2" /> <w:LsdException locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1" /> <w:LsdException locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2" /> <w:LsdException locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1" /> <w:LsdException locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2" /> <w:LsdException locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3" /> <w:LsdException locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List" /> <w:LsdException locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading" /> <w:LsdException locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List" /> <w:LsdException locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid" /> <w:LsdException locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1" /> <w:LsdException locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1" /> <w:LsdException locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1" /> <w:LsdException locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1" /> <w:LsdException locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1" /> <w:LsdException locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1" /> <w:LsdException locked="false" unhidewhenused="false" name="Revision" /> <w:LsdException locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph" /> <w:LsdException locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote" /> <w:LsdException locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote" /> <w:LsdException locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1" /> <w:LsdException locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1" /> <w:LsdException locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1" /> <w:LsdException locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1" /> <w:LsdException locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1" /> <w:LsdException locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1" /> <w:LsdException locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1" /> <w:LsdException locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1" /> <w:LsdException locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2" /> <w:LsdException locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2" /> <w:LsdException locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2" /> <w:LsdException locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2" /> <w:LsdException locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2" /> <w:LsdException locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2" /> <w:LsdException locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2" /> <w:LsdException locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2" /> <w:LsdException locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2" /> <w:LsdException locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2" /> <w:LsdException locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2" /> <w:LsdException locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2" /> <w:LsdException locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2" /> <w:LsdException locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2" /> <w:LsdException locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3" /> <w:LsdException locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3" /> <w:LsdException locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3" /> <w:LsdException locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3" /> <w:LsdException locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3" /> <w:LsdException locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3" /> <w:LsdException locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3" /> <w:LsdException locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3" /> <w:LsdException locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3" /> <w:LsdException locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3" /> <w:LsdException locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3" /> <w:LsdException locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3" /> <w:LsdException locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3" /> <w:LsdException locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3" /> <w:LsdException locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4" /> <w:LsdException locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4" /> <w:LsdException locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4" /> <w:LsdException locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4" /> <w:LsdException locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4" /> <w:LsdException locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4" /> <w:LsdException locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4" /> <w:LsdException locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4" /> <w:LsdException locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4" /> <w:LsdException locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4" /> <w:LsdException locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4" /> <w:LsdException locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4" /> <w:LsdException locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4" /> <w:LsdException locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4" /> <w:LsdException locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5" /> <w:LsdException locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5" /> <w:LsdException locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5" /> <w:LsdException locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5" /> <w:LsdException locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5" /> <w:LsdException locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5" /> <w:LsdException locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5" /> <w:LsdException locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5" /> <w:LsdException locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5" /> <w:LsdException locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5" /> <w:LsdException locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5" /> <w:LsdException locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5" /> <w:LsdException locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5" /> <w:LsdException locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5" /> <w:LsdException locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6" /> <w:LsdException locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6" /> <w:LsdException locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6" /> <w:LsdException locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6" /> <w:LsdException locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6" /> <w:LsdException locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6" /> <w:LsdException locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6" /> <w:LsdException locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6" /> <w:LsdException locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6" /> <w:LsdException locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6" /> <w:LsdException locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6" /> <w:LsdException locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6" /> <w:LsdException locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6" /> <w:LsdException locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6" /> <w:LsdException locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis" /> <w:LsdException locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis" /> <w:LsdException locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference" /> <w:LsdException locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference" /> <w:LsdException locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title" /> <w:LsdException locked="false" priority="37" name="Bibliography" /> <w:LsdException locked="false" priority="39" qformat="true" name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--> <!-- [if gte mso 10]> <mce:style><!-- /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-font-kerning:1.0pt;} --> <!-- [endif]-->
除了 AutoCompleteTextView 组 件外,我们还可以使用 MultiAutoCompleteTextView 组件来完成连续输入的功能。也就是说,当输入完一个字符串后,在该字符串后面输入一个逗号( , ),在逗号前后可以有任意多个空格,然后 再输入一个字符串(例如,“手机”),仍然会显示辅助输入的列表,但要使用 MultiAutoCompleteTextView 类的 setTokenizer 方法指定 MultiAutoCompleteTextView.CommaTokenizer 类的对象实例(该对象表示输入多个字符串时的分隔符为逗号),代码如下:
(MultiAutoCompleteTextView)findViewById(R.id.multiAutoCompleteTextView);
multiAutoCompleteTextView.setAdapter(adapter);
multiAutoCompleteTextView.setTokenizer( new MultiAutoCompleteTextView.CommaTokenizer());
<!-- [if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:DoNotShowRevisions /> <w:DoNotPrintRevisions /> <w:DoNotShowMarkup /> <w:DoNotShowComments /> <w:DoNotShowInsertionsAndDeletions /> <w:DoNotShowPropertyChanges /> <w:PunctuationKerning /> <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>ZH-CN</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:SpaceForUL /> <w:BalanceSingleByteDoubleByteWidth /> <w:DoNotLeaveBackslashAlone /> <w:ULTrailSpace /> <w:DoNotExpandShiftReturn /> <w:AdjustLineHeightInTable /> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> <w:UseFELayout /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val="--> <!-- [endif]--><!-- [if gte mso 9]><xml> <w:LatentStyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"> <w:LsdException locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal" /> <w:LsdException locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 2" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 3" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 4" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 5" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 6" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 7" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 8" /> <w:LsdException locked="false" priority="9" qformat="true" name="heading 9" /> <w:LsdException locked="false" priority="39" name="toc 1" /> <w:LsdException locked="false" priority="39" name="toc 2" /> <w:LsdException locked="false" priority="39" name="toc 3" /> <w:LsdException locked="false" priority="39" name="toc 4" /> <w:LsdException locked="false" priority="39" name="toc 5" /> <w:LsdException locked="false" priority="39" name="toc 6" /> <w:LsdException locked="false" priority="39" name="toc 7" /> <w:LsdException locked="false" priority="39" name="toc 8" /> <w:LsdException locked="false" priority="39" name="toc 9" /> <w:LsdException locked="false" priority="35" qformat="true" name="caption" /> <w:LsdException locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title" /> <w:LsdException locked="false" priority="1" name="Default Paragraph Font" /> <w:LsdException locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle" /> <w:LsdException locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong" /> <w:LsdException locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis" /> <w:LsdException locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid" /> <w:LsdException locked="false" unhidewhenused="false" name="Placeholder Text" /> <w:LsdException locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing" /> <w:LsdException locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading" /> <w:LsdException locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List" /> <w:LsdException locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid" /> <w:LsdException locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1" /> <w:LsdException locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2" /> <w:LsdException locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1" /> <w:LsdException locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2" /> <w:LsdException locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1" /> <w:LsdException locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2" /> <w:LsdException locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3" /> <w:LsdException locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List" /> <w:LsdException locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading" /> <w:LsdException locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List" /> <w:LsdException locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid" /> <w:LsdException locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1" /> <w:LsdException locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1" /> <w:LsdException locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1" /> <w:LsdException locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1" /> <w:LsdException locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1" /> <w:LsdException locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1" /> <w:LsdException locked="false" unhidewhenused="false" name="Revision" /> <w:LsdException locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph" /> <w:LsdException locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote" /> <w:LsdException locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote" /> <w:LsdException locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1" /> <w:LsdException locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1" /> <w:LsdException locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1" /> <w:LsdException locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1" /> <w:LsdException locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1" /> <w:LsdException locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1" /> <w:LsdException locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1" /> <w:LsdException locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1" /> <w:LsdException locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2" /> <w:LsdException locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2" /> <w:LsdException locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2" /> <w:LsdException locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2" /> <w:LsdException locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2" /> <w:LsdException locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2" /> <w:LsdException locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2" /> <w:LsdException locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2" /> <w:LsdException locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2" /> <w:LsdException locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2" /> <w:LsdException locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2" /> <w:LsdException locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2" /> <w:LsdException locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2" /> <w:LsdException locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2" /> <w:LsdException locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3" /> <w:LsdException locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3" /> <w:LsdException locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3" /> <w:LsdException locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3" /> <w:LsdException locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3" /> <w:LsdException locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3" /> <w:LsdException locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3" /> <w:LsdException locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3" /> <w:LsdException locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3" /> <w:LsdException locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3" /> <w:LsdException locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3" /> <w:LsdException locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3" /> <w:LsdException locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3" /> <w:LsdException locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3" /> <w:LsdException locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4" /> <w:LsdException locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4" /> <w:LsdException locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4" /> <w:LsdException locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4" /> <w:LsdException locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4" /> <w:LsdException locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4" /> <w:LsdException locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4" /> <w:LsdException locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4" /> <w:LsdException locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4" /> <w:LsdException locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4" /> <w:LsdException locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4" /> <w:LsdException locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4" /> <w:LsdException locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4" /> <w:LsdException locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4" /> <w:LsdException locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5" /> <w:LsdException locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5" /> <w:LsdException locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5" /> <w:LsdException locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5" /> <w:LsdException locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5" /> <w:LsdException locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5" /> <w:LsdException locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5" /> <w:LsdException locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5" /> <w:LsdException locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5" /> <w:LsdException locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5" /> <w:LsdException locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5" /> <w:LsdException locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5" /> <w:LsdException locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5" /> <w:LsdException locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5" /> <w:LsdException locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6" /> <w:LsdException locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6" /> <w:LsdException locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6" /> <w:LsdException locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6" /> <w:LsdException locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6" /> <w:LsdException locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6" /> <w:LsdException locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6" /> <w:LsdException locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6" /> <w:LsdException locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6" /> <w:LsdException locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6" /> <w:LsdException locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6" /> <w:LsdException locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6" /> <w:LsdException locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6" /> <w:LsdException locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6" /> <w:LsdException locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis" /> <w:LsdException locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis" /> <w:LsdException locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference" /> <w:LsdException locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference" /> <w:LsdException locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title" /> <w:LsdException locked="false" priority="37" name="Bibliography" /> <w:LsdException locked="false" priority="39" qformat="true" name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--> <!-- [if gte mso 10]> <mce:style><!-- /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-font-kerning:1.0pt;} --> <!-- [endif]-->运行上面的代码后,在屏幕的第 2 个文本框中输入“ ab , ” 后,再输入“手机”,会显示如图 2 所示的效果。
2 U' i1 B1 Y9 ?+ mp4 /1 x/ x
新浪微博手机客户端(Android/Ophone版) 发布
《银 河系列原创教程》 发布
《Java Web开发速学宝典》 出版, 欢迎定购