服务器之家:专注于VPS、云服务器配置技术及软件下载分享
分类导航

PHP教程|ASP.NET教程|Java教程|ASP教程|编程技术|正则表达式|C/C++|IOS|C#|Swift|Android|VB|R语言|JavaScript|易语言|vb.net|

服务器之家 - 编程语言 - Android - android studio3.3.1代码提示忽略大小写的设置

android studio3.3.1代码提示忽略大小写的设置

2022-11-25 14:04Fredydeng Android

这篇文章主要介绍了android studio3.3.1代码提示忽略大小写的设置,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧

跟以往设置有区别,此处为取消红框勾选,设置即可

android studio3.3.1代码提示忽略大小写的设置

补充知识:Android Studio高级控件(自动提示文本框)

一、高级控件与低级控件区别?

是否使用适配器

二、适配器种类和作用

种类

1、数组适配器 ArrayAdapter

new ArrayAdapter(this,R.layout.actv_style, names);

2、简单适配器 SimpleAdapter

3、自定义适配器

三、高级控件使用步骤

1、获取数据

2、创建适配器

3、绑定适配器

例如:

1、自动提示文本框

独特属性:android:completionThreshold=”2”—–设置输入多少字符时自动匹配

1、AutoCompleteTextView(单一提示)

2、MultiAutoCompleteTextView(多次提示)

设置多次提示时,设置分隔符方法

mactv_main.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());

activity_main.xml

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?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

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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 获取数据
    data1 = new String[] { "愤怒的小鸟", "汤姆猫", "落汤鸡", "牛牛", "哈巴狗", "神龙", "烤鸭",
        "小象", "美人鱼", "九尾狐" };
//    3.2 创建适配器
    adapter1 = new ArrayAdapter<String>(this,R.layout.act_main_item1,data1);
//    3.3 绑定适配器
    act_main_act1.setAdapter(adapter1);
 
    //设置分隔符
 
    adapter4 = new ArrayAdapter<String>(this,R.layout.act_main_item1,data1);
    mact_main_mact1.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
    mact_main_mact1.setAdapter(adapter4);
 
 
  }
 
}

在layout中写一个项资源

android studio3.3.1代码提示忽略大小写的设置

?
1
2
3
4
5
6
7
<?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代码提示忽略大小写的设置就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持服务器之家。

原文链接:https://blog.csdn.net/Fredydeng/article/details/87941151

延伸 · 阅读

精彩推荐
  • Androidandroid开启免提切换功能示例

    android开启免提切换功能示例

    这篇文章主要介绍了android开启免提切换功能示例,需要的朋友可以参考下...

    Android开发网3872021-02-28
  • AndroidAndroid控件CardView实现卡片布局

    Android控件CardView实现卡片布局

    这篇文章主要为大家详细介绍了Android控件CardView实现卡片布局,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...

    简单不一定不好4692022-08-11
  • AndroidAndroid开发实现自定义Toast、LayoutInflater使用其他布局示例

    Android开发实现自定义Toast、LayoutInflater使用其他布局示例

    这篇文章主要介绍了Android开发实现自定义Toast、LayoutInflater使用其他布局,涉及Android自定义Toast与界面布局相关操作技巧,需要的朋友可以参考下...

    水中鱼之19999752022-10-07
  • AndroidAndroidQ 沙箱适配多媒体文件(小结)

    AndroidQ 沙箱适配多媒体文件(小结)

    这篇文章主要介绍了AndroidQ 沙箱适配多媒体文件(小结),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友...

    DesGemini7072022-11-09
  • Android分享五种Android常用布局方式

    分享五种Android常用布局方式

    Android布局是应用界面开发的重要一环,在Android中,共有五种布局方式,分别是:FrameLayout(框架布 局),LinearLayout (线性布局),AbsoluteLayout(绝对布局...

    doudoubaba01019712021-04-13
  • AndroidAndroid RecyclerView实现拼团倒计时列表实例代码

    Android RecyclerView实现拼团倒计时列表实例代码

    这篇文章主要给大家介绍了关于Android RecyclerView实现拼团倒计时列表的相关资料,文中通过示例代码介绍的非常详细,对各位Android开发者们具有一定的参考...

    黄二瓜11582022-10-31
  • AndroidAndroid LineChart绘制多条曲线的方法

    Android LineChart绘制多条曲线的方法

    这篇文章主要为大家详细介绍了Android LineChart绘制多条曲线的方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...

    Vivinia_Vivinia11502022-10-18
  • AndroidAndroid文件下载进度条的实现代码

    Android文件下载进度条的实现代码

    我们今天开始学习的是下载进度的实现。今天的这段代码是网上找的,自己做了些小改,通过模拟器测试。文件下载进度条控制(就是为了高清壁纸加个进...

    Android开发网7572021-01-04