English 中文(简体)
Eclipse中的主题审查失败
原标题:Theme preview fails in Eclipse

I have made a simple username/password dialog to which I want to apply a theme (it basically defines windowBackground) and would also like to preview in Eclipse.

我看到,我的主题在“Theme combo”盒子里与其他主题一起展示,但选择这个主题会产生以下错误:

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)

Theme definition:

<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>

偷窃工作罚款。 然而,WYSIWYG将更能理解。

最佳回答

Close your layout files in the editor first and restart your Eclipse.

问题回答

I also got this problem. I solved it by changing theme. Steps to do this

  1. Open activity in "Graphic Layout"
  2. Click drop down list AppTheme (On top bar of activity "Graphic Layout")
  3. Select Project Themes->AppBaseTheme

你们应在图表中选择另一个主题(如缺省主题)。 我认为,你的习俗主题不支持某种特性。

确保你在不同的价值观下的其他一切风格,包括你的习俗主题部分。

I had similar problem. In my case I had added a custom theme in values-large folder under res. And it was working at runtime but giving error as yours in eclipse. So i tried adding the custom part(in my case totally there was 3 tags added to styles.xml file) in all other styles.xml file. i.e. styles.xml files under values-normal-hdpi, values-normal-mdpi, valuse-v11 and values-v14...

And BOOM!!! It solved my problem which wasted my whole day.





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...