【发布时间】:2018-12-12 20:42:47
【问题描述】:
我最近刚刚更新了我的 Android Studio,从那以后,我在预览/设计编辑器中的按钮上没有显示 ThemeOverlay 属性,这与更新之前一样。但是,当我在设备上运行应用程序时,ThemeOverlay 可以工作。下面是按钮的一些测试代码。我已将按钮的背景属性设置为蓝色,并将按钮的文本设置为测试我
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test Me"
android:background="#0000FF"
android:layout_marginTop="20dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark"/>
</LinearLayout>
主题属性设置为 TheOverLay.AppCompat.Dark,以便按钮上的文本很亮,但它不会显示在 Android Studio 的设计编辑器/预览中。文本仍显示为深色/黑色。当我在连接的设备上运行它时,它工作正常。 这是因为当前更新发生了一些变化吗?
【问题讨论】:
标签: android android-studio android-layout