I do not want to use the framework provided Preferences, rather I would like to create a ListView that looks similar. In particular, I would like it to use the same font size and style for the TextViews.
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.
This is not about the ListView itself, but rather the child views that appear inside the ListView. They are created by the getView method of your adapter.
To create views similar to Android, you can use the Android source code, specifically the relevant XML file layouts. For example, preference.xml looks like this:
You will not be able to use this content directly, as some of the constants used are private to Android, and you’ll have to further dig down through other xml’s.
Anyhow, you should take into account that Android preferences look different on different versions of Android, and on different themes, so make sure you use the constants provided by Android, and not your own hard-coded values, to make sure your list-view items resemble the actual preferences provided by Android.