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

補充知識:Android Studio高級控件(自動提示文本框)
一、高級控件與低級控件區(qū)別?
是否使用適配器
二、適配器種類和作用
種類
1、數(shù)組適配器 ArrayAdapter
new ArrayAdapter(this,R.layout.actv_style, names);
2、簡單適配器 SimpleAdapter
3、自定義適配器
三、高級控件使用步驟
1、獲取數(shù)據(jù)
2、創(chuàng)建適配器
3、綁定適配器
例如:
1、自動提示文本框
獨特屬性:android:completionThreshold=”2”—–設(shè)置輸入多少字符時自動匹配
1、AutoCompleteTextView(單一提示)
2、MultiAutoCompleteTextView(多次提示)
設(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">
<!--自動提示文本框-->
<!--(單一提示)-->
<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、
// 高級控件使用步驟
// 3.1 獲取數(shù)據(jù)
data1 = new String[] { "憤怒的小鳥", "湯姆貓", "落湯雞", "牛牛", "哈巴狗", "神龍", "烤鴨",
"小象", "美人魚", "九尾狐" };
// 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中寫一個項資源

<?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代碼提示忽略大小寫的設(shè)置就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
Android 使用手機(jī)NFC的讀取NFC標(biāo)簽數(shù)據(jù)的方法
這篇文章主要介紹了Android 使用手機(jī)NFC的讀取NFC標(biāo)簽數(shù)據(jù)的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-07-07
Android實現(xiàn)打開各種文件的intent方法小結(jié)
這篇文章主要介紹了Android實現(xiàn)打開各種文件的intent方法,結(jié)合實例形式總結(jié)分析了Android針對HTML、圖片文件、pdf文件、文本文件、音頻文件、視頻文件等的intent打開方法,需要的朋友可以參考下2016-08-08
Android中 自定義數(shù)據(jù)綁定適配器BaseAdapter的方法
本篇文章小編為大家介紹,Android中 自定義數(shù)據(jù)綁定適配器BaseAdapter的方法。需要的朋友參考下2013-04-04
通過實例簡單講解Android App中的Activity組件
這篇文章主要介紹了通過Android App中的Activity組件,包括Activity的定義和繼承以及啟動等基本知識,需要的朋友可以參考下2016-04-04
Android創(chuàng)建服務(wù)之started service詳細(xì)介紹
這篇文章主要介紹了Android創(chuàng)建服務(wù)之started service,需要的朋友可以參考下2014-02-02

