android studio3.3.1代碼提示忽略大小寫(xiě)的設(shè)置
跟以往設(shè)置有區(qū)別,此處為取消紅框勾選,設(shè)置即可

補(bǔ)充知識(shí):Android Studio高級(jí)控件(自動(dòng)提示文本框)
一、高級(jí)控件與低級(jí)控件區(qū)別?
是否使用適配器
二、適配器種類(lèi)和作用
種類(lèi)
1、數(shù)組適配器 ArrayAdapter
new ArrayAdapter(this,R.layout.actv_style, names);
2、簡(jiǎn)單適配器 SimpleAdapter
3、自定義適配器
三、高級(jí)控件使用步驟
1、獲取數(shù)據(jù)
2、創(chuàng)建適配器
3、綁定適配器
例如:
1、自動(dòng)提示文本框
獨(dú)特屬性:android:completionThreshold=”2”—–設(shè)置輸入多少字符時(shí)自動(dòng)匹配
1、AutoCompleteTextView(單一提示)
2、MultiAutoCompleteTextView(多次提示)
設(shè)置多次提示時(shí),設(shè)置分隔符方法
mactv_main.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<!--自動(dòng)提示文本框-->
<!--(單一提示)-->
<AutoCompleteTextView
android:id="@+id/act_main_act1"
android:layout_width="match_parent"
android:layout_height="60dp"
android:hint="單一提示"/>
<!--多次提示-->
<MultiAutoCompleteTextView
android:id="@+id/mact_main_mact1"
android:layout_width="match_parent"
android:completionThreshold="1"
android:layout_height="60dp"
android:hint="多次提示"/>
</LinearLayout>
MainActivity.java
package com.example.t212_a6;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.MultiAutoCompleteTextView;
import android.widget.SimpleAdapter;
import android.widget.Spinner;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class MainActivity extends AppCompatActivity {
private String[] data1;
private ArrayAdapter<String> adapter1;
private AutoCompleteTextView act_main_act1;
private ArrayAdapter<String> adapter4;
private MultiAutoCompleteTextView mact_main_mact1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
act_main_act1 = findViewById(R.id.act_main_act1);
mact_main_mact1 = findViewById(R.id.mact_main_mact1);
// 1、
// 高級(jí)控件使用步驟
// 3.1 獲取數(shù)據(jù)
data1 = new String[] { "憤怒的小鳥(niǎo)", "湯姆貓", "落湯雞", "牛牛", "哈巴狗", "神龍", "烤鴨",
"小象", "美人魚(yú)", "九尾狐" };
// 3.2 創(chuàng)建適配器
adapter1 = new ArrayAdapter<String>(this,R.layout.act_main_item1,data1);
// 3.3 綁定適配器
act_main_act1.setAdapter(adapter1);
//設(shè)置分隔符
adapter4 = new ArrayAdapter<String>(this,R.layout.act_main_item1,data1);
mact_main_mact1.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
mact_main_mact1.setAdapter(adapter4);
}
}
在layout中寫(xiě)一個(gè)項(xiàng)資源

<?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:textColor="@color/yellow" android:layout_height="match_parent"> </TextView>
以上這篇android studio3.3.1代碼提示忽略大小寫(xiě)的設(shè)置就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
Android 使用手機(jī)NFC的讀取NFC標(biāo)簽數(shù)據(jù)的方法
這篇文章主要介紹了Android 使用手機(jī)NFC的讀取NFC標(biāo)簽數(shù)據(jù)的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-07-07
Android實(shí)現(xiàn)打開(kāi)各種文件的intent方法小結(jié)
這篇文章主要介紹了Android實(shí)現(xiàn)打開(kāi)各種文件的intent方法,結(jié)合實(shí)例形式總結(jié)分析了Android針對(duì)HTML、圖片文件、pdf文件、文本文件、音頻文件、視頻文件等的intent打開(kāi)方法,需要的朋友可以參考下2016-08-08
Android中 自定義數(shù)據(jù)綁定適配器BaseAdapter的方法
本篇文章小編為大家介紹,Android中 自定義數(shù)據(jù)綁定適配器BaseAdapter的方法。需要的朋友參考下2013-04-04
通過(guò)實(shí)例簡(jiǎn)單講解Android App中的Activity組件
這篇文章主要介紹了通過(guò)Android App中的Activity組件,包括Activity的定義和繼承以及啟動(dòng)等基本知識(shí),需要的朋友可以參考下2016-04-04
Android實(shí)現(xiàn)后臺(tái)服務(wù)拍照功能
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)后臺(tái)服務(wù)拍照功能,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-05-05
Android創(chuàng)建服務(wù)之started service詳細(xì)介紹
這篇文章主要介紹了Android創(chuàng)建服務(wù)之started service,需要的朋友可以參考下2014-02-02
android LinearLayout 布局實(shí)例代碼
android LinearLayout 布局實(shí)例代碼,需要的朋友可以參考一下2013-04-04

