IDE:Android Studio 3.3

I am doing kotlin smart casting in RecyclerView adapter on ViewHolder.

override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
        holder as ViewHolder

Now every mention of viewholder is being highlighted, with text on hover saying "Smart Cast to ..." This is not a problem but really annoying. How can I disable this highlight feature?

screenshot

推荐答案

In the IDE prefererences, see:

Editor → Color scheme → Kotlin → Smart-casts → Smart-cast value

If you want to disable value smart-cast highlighting, just uncheck Background.

您可能还想配置其他类型的智能投射.

enter image description here

Kotlin相关问答推荐

如何将时间值格式化为00:00和00:00:00 Kotlin?""""

在Kotlin 有更好的结合方式?

&x是T&q;和&q;(x为?T)!=空(&Q;)?

捕捉异常是Kotlin协程中的反模式吗?

从 Kotlin 的父类获取函数注解

为什么 Kotlin main 函数需要 @JVMStatic 注解?

为什么这两个 Kotlin 协程函数不一样?

协程子作业(job)取消

Kotlin 函数有 2 个参数用于对 Map 或 List 进行排序

具有泛型类型的 Kotlin 密封接口不会为其子类型推断约束

如何缩短 MaterialTheme.colors.primary?

Kotlin RxJava 可空的错误

Android数据绑定在自定义视图中注入ViewModel

Kotlin 协程中的 Dispatchers.Main 和 Dispatchers.Default 有什么区别?

Kotlin通过映射委托属性,如果映射中不存在,则抛出NoTouchElementException

如何为kotlin异常生成SerialVersionId?

Kotlin Flow 收集后无法执行代码

你如何在 Kotlin 中注释 Pair 参数?

Kotlin中对象和数据类的区别是什么?

java.lang.NoClassDefFoundError:解析失败:Lkotlin/time/MonoClock