springer kow
Member
I use Fontawsome code '\f005' or '\f006' in CSS but the font does not display at all, if I change the code to something like '★', '★' will display on the page, Could anyone help me to solve the problem?
B4X:
'Class module:ComStarRatingEx
Sub Class_Globals
Public ABMComp As ABMCustomComponent
Dim myInternalName As String
End Sub
Public Sub Initialize(InternalPage As ABMPage, ID As String, radioName As String)
myInternalName = radioName
Dim CSS As String = $"
.stars-container {
font-family: FontAwesome;
position: relative;
display: inline-block;
color: transparent;
font-size: 60px;
}
.stars-container:before{
position: absolute;
top: 0;
left: 0;
content: '\f006';
color:green;
}
.stars-container:after {
position: absolute;
top: 0;
left: 0;
content: '\f005';
color: red;
overflow: hidden;
}
.stars-0:after { width: 0%; }
.stars-10:after { width: 10%; }
.stars-20:after { width: 20%; }
.stars-30:after { width: 30%; }
.stars-40:after { width: 40%; }
.stars-50:after { width: 50%; }
.stars-60:after { width: 60%; }
.stars-70:after { width: 70%; }
.stars-80:after { width: 80%; }
.stars-90:after { width: 90%; }
.stars-100:after { width: 100%;}
"$
ABMComp.Initialize("ABMComp", Me, InternalPage, ID, CSS)
End Sub
Sub ABMComp_Build(InternalPage As ABMPage, internalID As String) As String
Return $"<span class='stars-container stars-60'>\f005</span>"$
End Sub
public Sub ConnectPage()
Dim ss As CompStarRatingEx
ss.Initialize(page,"ss","ssss")
page.Cell(4,1).AddComponent(ss.ABMComp)
End Sub
[\code]
Last edited: