Android Question Why is ScrollView.Color Write-Only?

Widget

Well-Known Member
Licensed User
Longtime User
I am trying to get the DividerColor for the CustomListView by accessing the CLV.SV.Color but SV.Color is write-only.

1) Why define ScrollView and restrict Color property to write-only?
2) Is there another way to get the SV.Color at runtime?

TIA
 

Informatix

Expert
Licensed User
Longtime User
I am trying to get the DividerColor for the CustomListView by accessing the CLV.SV.Color but SV.Color is write-only.

1) Why define ScrollView and restrict Color property to write-only?
2) Is there another way to get the SV.Color at runtime?

TIA
Because Color is not a field with a value. When you set a color, B4A creates a ColorDrawable object with the specified color and replaces the view background with this drawable. There's currently no way (with B4A) to get back the color value used for this drawable.
If you need to store the integer value of the color to retrieve it later, you can use the Tag property of views.
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…