[Solved]How to get the panel 's color when using the library ?(I don't know that the panel's color will be)
I've created a CustomView (XUI) library which display the value of percent as code's belows cvs.DrawText(Progress & "%", mBase.Width / 2, mBase.Height - 60dip, xui.CreateDefaultFont(18), xui.Color_RGB(165,42,42), "CENTER") I need to contrast color 's the value of percent with the panel...
หมายเหตุ
แนะนำ เลือกใช้สีตรงข้ามกับ สี ของ mBase.Parent.color จะทำให้เกิดสีตัดกัน ทุกเฉกสี
สิ่งที่น่าสนใจ
B4X:
'Check Field for Parent's view
Private Sub HasField(jo As JavaObject,fieldName As String) As Boolean
Try
Dim cls As JavaObject=jo.GetField("java.lang.Object.class")
Dim fields() As Object= cls.RunMethod("getDeclaredFields",Null)
For Each field As JavaObject In fields
Dim name As String=field.RunMethod("getName",Null)
If name=fieldName Then
Return True
End If
Next
Catch
Log(LastException)
End Try
Return False
End Sub
Last edited: