安卓工作室 : Activity preview does not show title bar

标签 android android-studio android-titlebar

我知道这个问题已经在 here 之前提出了,但我已经尝试了给出的解决方案,但我没有像设备那样获得完全相同样式的预览外观。

我在 Android 版本 4.2.2 上使用 Samsung Galaxy S3 mini 作为我的设备调试,它完全没有修改,但我不明白为什么,即使我改变了主题,设备看起来仍然一样(与当然在 Activity 中进行了更改)

Activity 的代码就像任何新的空白 Activity 一样

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">

    <TextView android:text="@string/hello_world" android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</RelativeLayout>

预览图是这样的 enter image description here

但设备看起来像这样 enter image description here

PS:我正在学习android,所以我可能会对答案感到困惑

最佳答案

遇到了类似的问题。在我的例子中,它只是设计 View 的配置。在我标记“显示布局装饰”后,它按预期出现。 Show Layout Decorations

关于安卓工作室 : Activity preview does not show title bar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30362607/

相关文章:

java - 将图片从 URI 复制到文件时图片旋转了 90 度

android - 如何管理接收服务器响应的延迟?

android-studio - 自己备份Android studio项目时可以忽略哪些文件?

android - ViewPageIndicator- Jake Wharton- 为什么带有 viewpager 的选项卡显示的标题与 ICS 不同?

android - 如何禁用 FragmentActivity 中的窗口标题?

android - 在照片引用和 key 的帮助下使用改造库获取 body 响应中的照片

android - 如果用户有相机设置来存储位置数据,但手机位置已关闭,是否会存储位置?

android - 设备文件资源管理器和数据库修改时间

android - 在 android 库中包含 .json 文件,而不是在我的演示应用程序项目的/res/raw 或/assets 文件夹中

android - 如何在主 Activity 中隐藏标题栏 : I'm Using Android Studio