我嘗試爲API 8開發應用程序,但沒有任何styles.xml的經驗。對於應用程序中的活動,我使用Theme.Light。在玩風格之後,我得到了上面的錯誤。我也檢查了這個門戶網站上的其他帖子,我嘗試了很多建議,但我無法進一步探討。 styles.xml如下,希望有人會提出建議。試驗樣式=>找不到與給定名稱匹配的資源:attr
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
<style name="ContactLabelTextView">
<item name="layout_width">wrap_content</item>
<item name="layout_height">wrap_content</item>
<item name="layout_gravity">left|center_vertical</item>
<item name="layout_marginLeft">15dp</item>
<item name="layout_marginRight">5dp</item>
<item name="layout_marginTop">5dp</item>
<item name="clickable">false</item>
<item name="longClickable">false</item>
<item name="textSize">14sp</item>
<item name="textAppearance">?android:attr/textAppearanceMedium</item>
<item name="android:textColor">@android:color/black</item>
<item name="layout_marginBottom">5dp</item>
</style>
<style name="ContactMultiplineText" >
<item name="layout_width">match_parent</item>
<item name="layout_height">wrap_content</item>
<item name="layout_marginLeft">15dp</item>
</style>
請粘貼整個堆棧跟蹤。 – alanv 2014-08-29 22:38:11
請看看http://brainflush.wordpress.com/2009/03/15/understanding-android-themes-and-styles/也許它會幫助你理解造型 – 2014-08-29 23:25:03