Android Studio Emulator 显示标题栏但设计器不显示

Android Studio Emulator shows titlebar but designer does not

如标题所说。 android 模拟器正在显示标题栏,但是在我的设计器中标题栏不是他们的,所以当我启动模拟器时它会插入标题栏并将所有内容向下移动。 android studio 中是否有显示标题栏的设置?

谢谢

如果您想存根布局、文本、图像等,您可以使用 tools XML 命名空间。它仅适用于 Android Studio 的设计器工具。在您的最终申请中,什么都看不到。

例如,此代码存根 TextView 的内容:

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    tools:text="Hello!"
    />

不要忘记在根元素中声明名称空间:

<LinearLayout
    xmlns:android="..."
    xmlns:tools="..."
    />