Eclipse中的主题预览失败

usr*_*ΛΩΝ 28 android android-theme

我已经创建了一个简单的用户名/密码对话框,我想要应用一个主题(它基本上定义windowBackground),并且还要预览Eclipse.

我看到我的主题与主题组合框中的其他主题一起显示,但选择它会产生以下错误:

Missing styles. Is the correct theme chosen for this layout?
Use the Theme combo box above the layout to choose a different layout, or fix the theme style references.

Failed to find style 'textViewStyle' in current theme
android.content.res.Resources$NotFoundException
Couldn't find theme resource attr/textAppearanceLarge for the current theme
Exception details are logged in Window > Show View > Error Log
The following classes could not be found:
- TextView (Change to android.widget.TextView, Fix Build Path, Edit XML)
Run Code Online (Sandbox Code Playgroud)

主题定义:

<style name="my_theme">
    <item name="android:windowBackground">@drawable/form_header</item>
    <!-- <item name="android:padding">0dp</item>-->
    <item name="android:windowNoTitle">true</item>
</style>
Run Code Online (Sandbox Code Playgroud)

调试工作正常.然而,所见即所得将更加明显.

Sib*_*ang 45

首先在编辑器中关闭布局文件,然后重新启动Eclipse.

  • 您应该从图形布局视图的顶部选择列表中选择正确的自定义主题. (3认同)

小智 24

我也遇到了这个问题.我通过改变主题来解决它.这样做的步骤

  1. 在"图形布局"中打开活动
  2. 点击下拉列表AppTheme(活动顶部栏"图形布局")
  3. 选择Project Themes-> AppBaseTheme


小智 5

您应该在图形布局中选择另一个主题(例如:默认主题).我认为你的自定义主题不支持某些属性.