액션바 적용 유무에 따른 styles.xml 파일 내용
Actionbar를 API 11이상, API 7 이상으로 했을 때에 따른 styles.xml파일 내용 변경 점.
2일간 지우고 깔고 임포트하고 수차례 반복을 했다.
이클립스와 ADT 그리고 업데이트도 새로 받아서 설치했다.
기본 애플리케이션과 액티비티에 적용된 기본 테마는 Holo.Light.DarkActionBar이다.
이 테마는 안드로이드 프로젝트를 만들 때 기본 값으로 선택되는 theme이다.
[values 폴더]
API 11+
<style name="AppBaseTheme" parent="android:Theme.Light">
<style name="AppTheme" parent="AppBaseTheme">
API 7+
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
<style name="AppTheme" parent="AppBaseTheme">
------------
[values-v11 폴더]
API 11+
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
API 7+
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
-----------------
[values-v14 폴더]
API 11+
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
API 7+
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
------------------
<resources>
<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme"
parent="@android:style/Theme.AppCompat">
<item name="android:windowActionBarOverlay">true</item>
<!-- Support library compatibility -->
<item name="windowActionBarOverlay">true</item>
</style>
</resources>
똑같은 에러를 만났다.
android:windowActionBarOverlay requires API level 11 (current min is 7)
아래 두 줄을 추가하면 해결된다.
<resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">
<item tools:targetApi="11" name="android:windowActionBarOverlay">true</item>
다른 방법으로는
<resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">
<item name="android:windowActionBarOverlay" tools:ignore="NewApi">true</item>
와 같이 작성하면 되겠다
styles.xml에서 부모를 접두어 "android:"를 빼고 아래와 같이 둔다
parent="@style/Theme.AppCompat"
그리고 Androidmenifest.xml에서
android:minSdkVersion="7"
마지막으로
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
으로 해서 AppTheme를 불러주었으나 여전히도 이해할 수 없는 오류가 니오고 있다.
'Android 안드로이드' 카테고리의 다른 글
이클립스 단축키, 안드로이드 AVD 단축키 (0) | 2014.12.04 |
---|---|
Dialog 대화상자 만들기 두 가지 (0) | 2014.12.02 |
Failed to create the java virtual machine (0) | 2014.11.29 |
안드로이드 프로가드 에러 Proguard returned with error code 1. See console (0) | 2014.11.28 |
구글 플레이 923 에러 (0) | 2014.11.25 |