我想在我的应用程序首选项中添加一个选项,允许用户选择颜色,但不确定是否有好的策略。我有一个可以在对话框中显示的颜色选择器,因此我可以使用对话框首选项。但我没有看到在对话框首选项中指示当前颜色是什么的好方法(我希望能够向首选项布局添加颜色“样本”,以指示当前颜色;或类似的东西)。关于如何做出用户友好的颜色偏好有什么建议吗?
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 preference. 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?
发布评论
评论(3)
我尝试了这个: mColorPicker
它非常容易使用。您可以下载代码并查看示例。
它看起来是这样的:
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:
看看这是否对您有帮助:
http://code.google.com/p/android -颜色选择器/
see if this helps you out:
http://code.google.com/p/android-color-picker/
我需要相同的首选项界面,看起来应该可以通过覆盖 getLayoutResource() 在 Preference 基类中,并实现 xml 布局以包含样本。
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.