CTRL+空格键不显示布局



当我键入R.layout.并按CTRL+SPACE时,它只显示activity_main布局,但我需要存在的fragment_settings布局。它没有看到任何新的布局。我怎样才能让它看到这个布局?

package com.example.navdrawer;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
public class SettingsFragment extends Fragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout./*fragment_settings*/, container, false);
}
}

fragment_settings.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:background="@android:color/holo_red_light">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Settings"
android:textSize="30sp"
android:layout_centerInParent="true"/>
</RelativeLayout>

我的布局它为我提供了什么

因此,这是一个android studio IDE错误,请尝试按以下顺序修复:

  1. 构建->生成项目
  2. 构建->重建项目
  3. 文件->使缓存无效/重新启动