代码之家  ›  专栏  ›  技术社区  ›  Nitish

Project quick fix快捷方式未在Android Studio中显示所有选项

  •  0
  • Nitish  · 技术社区  · 8 年前

    我在布局文件中有一个硬编码字符串。根据 Android Studio shortcut list ,则, 选项+输入 用于显示可用于Mac的项目快速修复。 These 是应该实际出现的选项,但这是我得到的全部(我悬停在 android:contentDescription="background image" ):

    enter image description here

    而且选项从不一致,也就是说,它们不断变化,如下所示:

    enter image description here



    enter image description here

    但我从来没有像第二个链接中提到的那样提取字符串资源(如下所示):

    enter image description here

    1 回复  |  直到 8 年前
        1
  •  2
  •   Ameya Pandilwar    8 年前

    为了保证每次都能这样做,您应该确保在按下之前将文本光标放在字符串内 option + enter

    遵循以下步骤--

    1. 通过定位或单击字符串,将文本光标放置在字符串内,直到看到字符串之间闪烁的光标

    enter image description here

    1. 选项 + 进来 。保证每次都能正常工作

    enter image description here