Widget Well-Known Member Licensed User Longtime User Aug 2, 2016 #1 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
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 Aug 2, 2016 #2 Widget said: 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 Click to expand... 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: Aug 2, 2016 Upvote 0
Widget said: 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 Click to expand... 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.