android導入項目出現style錯誤,menu錯誤
?
style
//查看 res/values/styles.xml 下的報錯點。<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
//把這個改成 <style name="AppBaseTheme" parent="android:Theme.Light"> //路徑: res/values-11/styles.xml <style name="AppBaseTheme" parent="Theme.AppCompat.Light"> //把這個改成 <style name="AppBaseTheme" parent="android:Theme.Holo.Light"> //路徑: res/values-14/styles.xml <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar"> //把這個換成 <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
meun
No resource identifier found for attribute 'showAsAction' in package 'android' 運行一個項目時在一個menu.xml文件item屬性android:showAsAction 報錯 No resource identifier found for attribute 'showAsAction' in package 'android' google了下,老外說是版本問題,showAsAction was added in API level 11要將API提升到11,添加 "android-support-v7-appcompat.jar" 到Android庫( Private Libraries) android:showAsAction = "never" 當你的應用程序目標設為蜂巢平臺時,你可以利用Action Bar部件提供的全部功能,將你的選項菜單項放在Action Bar的右上角,對用戶來說使用更方便,控制該行為的主菜單項屬性是android:showAsAction。 這個屬性可接受的值有: 1、always:這個值會使菜單項一直顯示在Action Bar上。 2、ifRoom:如果有足夠的空間,這個值會使菜單項顯示在Action Bar上。 3、never:這個值使菜單項永遠都不出現在Action Bar上。 4、withText:這個值使菜單項和它的圖標,菜單文本一起顯示。 不過這里沒有用到這高版本,此處刪除這個屬性就OK了。