I am using PreferenceActivity, how can I set a custom title bar? Not only text but background color, size – the whole layout.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
PreferenceActivity extends ListActivity, and when you inflate the preferences from xml withaddPreferencesFromResource(), it puts the stuff into the standardListViewthatListActivityuses.So basically, you can use
setContentView()to specify a layout, but you need to have aListViewin it with the id"@+android:id/list".So using kleini’s example code:
You would need a ListView in
login_settings_layout.xmlthat looks something like: