Bob, joebowbeer, skink

Thanks so much for your help!!
I successfully managed to change the layout of preference.

As joebowbeer wrote, I changed the top-level background image and
listview setting in my code like below.
 
getWindow().setBackgroundDrawableResource(R.drawable.my_background);
        getListView().setBackgroundColor(Color.TRANSPARENT);
        getListView().setCacheColorHint(Color.TRANSPARENT);

Then, I supplied the custom layout to the android:layout attribute in
xml in order to change other child preferences as Bob stated.
    <PreferenceScreen xmlns:android="http://schemas.android.com/apk/
res/android">
        <PreferenceCategory android:title="test_title"
android:layout="@xml/preference_category">
            <EditTextPreference
                android:key="edit_key"
                android:title="edit_title"
                android:summary="edit_summary"
                android:layout="@xml/preference"
                />
        </PreferenceCategory>
    </PreferenceScreen>


Thank you very much!!


On Feb 17, 8:09 am, skink <[email protected]> wrote:
> On Feb 16, 10:51 pm, joebowbeer <[email protected]> wrote:
>
>
>
>
>
> > Something like this:
>
> > public class MyPreferenceActivity extends PreferenceActivity {
>
> >     @Override
> >     protected void onCreate(Bundle savedInstanceState) {
> >         super.onCreate(savedInstanceState);
>
> > getWindow().setBackgroundDrawableResource(R.drawable.my_background);
> >         getListView().setBackgroundColor(Color.TRANSPARENT);
> >         getListView().setCacheColorHint(Color.TRANSPARENT);
> >         getPreferenceManager().setSharedPreferencesName("my_prefs");
> >         addPreferencesFromResource(R.xml.my_preferences);
> >     }
>
> > I'm not sure if the listView changes are necessary or advisable.
>
> > Joe
>
> > On Feb 16, 3:33 am, Vincent <[email protected]> wrote:
>
> > > Hi,
>
> > > Does anybody know how to change the background color of Preference
> > > (PreferenceCategory, EditTextPreference ...) ?
>
> > > I wanna do like this:
> > > <PreferenceCategory android:title="title_test"
> > > android:background="@color/testColor">
> > > But this doesn't work...
> > > I searched these by using google, but couldn't find any right
> > > answer...
>
> > > Also, I couldn't find any way to change other layouts. (e.g. text
> > > color, size and style of preference title or summary)
> > > Is there no way to customize the layout of Preferences?
> > > It'll be great if somebody can help me out.
>
> > > thanks in advance!
>
> i'm afraid it works only for top-level preferences.
>
> if you have inner ScreenPreferences it won't work as ScreenPreferences
> use Dialogs in order to show their child Preferences
>
> pskink

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to