간단한 preference_headers.xml
파일이 있습니다. 내 기본 설정 헤더에 몇 가지 범주를 추가하고 싶습니다. 내 preference_headers.xml
에 <PreferenceCategory />
을 구현하려고했지만 작동하지 않습니다. API 레벨 11을 사용하고 있습니다. 아래 그림과 같이 official website의 Android 개발자가 카테고리를 추가 할 수 있습니다. 어떻게 추가 할 수 있습니까? 여기 기본 설정 머리글에 범주를 추가하는 방법은 무엇입니까?
그리고
내preference_headers.xml
코드 몇입니다. 작동하지 않습니다 :
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="ACCOUNT" >
<header android:fragment="com.example.preferenceheader.SettingsFragmentAccount"
android:title="@string/pref_header_category_account"
android:summary="@string/pref_header_summ_account"
android:icon="@drawable/ic_action_settings" />
</PreferenceCategory>
<PreferenceCategory android:title="APPLICATION" >
<header android:fragment="com.example.preferenceheader.SettingsFragmentApplication"
android:title="@string/pref_header_category_application"
android:summary="@string/pref_header_summ_application"
android:icon="@drawable/ic_action_group" />
</PreferenceCategory>
</preference-headers>
도움 주셔서 감사합니다.
실제 환경 설정이 필요하지 않습니까? – Doomsknight
실제 환경 설정이란 무엇입니까? 나는 이해하지 못한다. –
체크 아웃 http://gmariotti.blogspot.in/2013/01/preferenceactivity-preferencefragment.html 그들은 훌륭하게 설명했습니다. –