我知道这个问题之前已经有人提出过(这里),但我尝试了给出的解决方案,但预览效果与设备的完全一样。
我使用的是安卓版本4.2.2的三星Galaxy S3 mini作为我的设备调试,它完全没有改动,但我不明白为什么即使我更改主题,设备看起来仍然一样(当然在活动中做出了更改)。
活动的代码就像任何新的空白活动一样。
<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>
预览看起来像这样:
![输入图像描述](https://istack.dev59.com/KJFrX.webp)
![输入图像描述](https://istack.dev59.com/l3aaI.webp)