Java Question Custom properties default color

corwin42

Expert
Licensed User
Longtime User
Hello,

I'm just playing around with the new customview designer properties. I have a color property but I want it to default to the standard color that the view uses if no explicit color is set.

The internal views have a color of "Default color" which uses the default color of the view. Seems that it is not possible to use this for custom views. Setting the default color property to an empty string raises an error. Is there a trick or is this somehow possible?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Custom views currently do not support nullable colors.

The best thing that you can do is to set the default color to: 0xfff0f8ff
In your code check whether the color value is equal to ViewWrapper.defaultColor. If it is then don't set the color.

In the future when nullable colors will be supported this value will be converted to "default color" with a check box.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…