本文介绍了Android Studio 3.0参数提示信息不总是可见的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,我不知道该新功能的确切名称,请查看屏幕截图:

Sorry, I don't know how this new functionality is called exactly, please look at screenshot:

因此,参数名称在方法调用中可见.这很酷,但是如您所见,在这种情况下,只有第一个参数,第二个没有可见的名称.根据我的观察,它有时可行,有时却无效,我无法弄清原因.

So, parameter name is visible in method call. This is cool, but as you can see, only first parameter in this case, second has no name visible. From my observations, it sometimes works, sometimes it doesn't and I am unable to figure out why.

我可以配置它,还是只是一个错误?也许我不明白该功能的工作原理.

Can I configure it, or it's just a bug? Or maybe I'm not understand how that functionality is intended to work.

推荐答案

您可以通过执行以下操作来启用它:

You can enable it by doing the following:

  1. 转到文件>设置>编辑器>一般>外观>显示参数名称提示
  2. 点击配置
  3. 语言:-> Java
  4. 选项->选中即使表达式类型清晰也显示提示

如下所示,无论类型如何,所有参数均可见:

As you can see below, it is visible for all parameters regardless of type:

编辑

该设置似乎已在Android Studio 4.0中删除

It looks like this setting was removed in Android Studio 4.0

但是,有新的 Inlay Hints (镶嵌提示)选项:

There are however new Inlay Hints options:

  1. 转到文件>设置>编辑器>镶嵌提示Java>参数提示
  2. 检查显示以下参数的提示:

这篇关于Android Studio 3.0参数提示信息不总是可见的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 17:11