开发者

Android: Color preference?

开发者 https://www.devze.com 2023-02-24 20:55 出处:网络
I would like to add an option to my application preferences that allows users to select a color, but am not sure of a good strategy.I have a color picker which I can show in a dialog, so I could use a

I would like to add an option to my application preferences that allows users to select a color, but am not sure of a good strategy. I have a color picker which I can show in a dialog, so I could use a dialog prefe开发者_开发百科rence. But I see no good way of indicating in the dialog preference what the current color is (I would like to be able to add a "swatch" of color to the preference layout, to indicate the current color; or something similar). Any suggestions for how to make a user friendly color preference?


I tried this one: mColorPicker

It is very easy to use. You can download the code and see an example.

This is how it looks:

Android: Color preference?


see if this helps you out:

http://code.google.com/p/android-color-picker/


I need the same preference interface, and it looks like displaying the color swatch should be possible by overriding getLayoutResource() in the base Preference class and implementing an xml layout to include the swatch.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号