B4J Question xCustomListView B4XView Change TextSize

rwblinn

Well-Known Member
Licensed User
Longtime User
Created a B4J Version of the atHome B4A App.

Items in the xCLV are created using sub below (example for weather tabpage).
All labels manually changed to a B4XView.

Issue
The property TextSize of a Label (B4XView) is increased.
If NOT assigning the Color property, the TextSize does not change.

Question
Is this a bug or is there another way of setting the TextSize for a B4XView.
B4X:
LabelWeatherItemName.TextSize = 24
NO Change
upload_2018-10-3_14-29-6.png

B4X:
LabelWeatherItemName.TextSize = 24
LabelWeatherItemName.Color = xui.Color_White
Change OK
upload_2018-10-3_14-31-32.png


B4X:
' Create a WeatherItem for the xCustomListView
' [Label Name][Label Data]
' The item is created from the list containing the weather idx
' The labels are manually changed to a B4XView Object
Private Sub CreateWeatherItem(iv As WeatherItemValue) As B4XView
   ' Create a panel holding the labels
   Dim p As B4XView = xui.createpanel("")
   p.SetLayoutAnimated(0,0,0,-1,Constants.CLVITEMHEIGHTWEATHER)
   ' Load the layout with the two labels
   p.LoadLayout("weatheritem")
   p.Color = xui.Color_White
   'Set properties of the labels
   LabelWeatherItemName.Height = Constants.CLVITEMHEIGHTWEATHER
   LabelWeatherItemData.Height = Constants.CLVITEMHEIGHTWEATHER
   LabelWeatherItemName.TextSize = 24
   LabelWeatherItemName.Color = xui.Color_White
   LabelWeatherItemData.TextSize = 24
   LabelWeatherItemData.Color = xui.Color_White
   ' Assign the labels to the type
   iv.Idx = ""
   iv.Name = LabelWeatherItemName
   iv.Data = LabelWeatherItemData
   ' Return the panel
   Return p
End Sub
 

rwblinn

Well-Known Member
Licensed User
Longtime User
... setting it with the designer?
Forgot to mention:
That's what I did in the first place. The label preview shows the label with increased font, but the font is shown with default size after loading the layout.
Thats why tried to change within the Sub (which indeed is not the preferred way).
 
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
Will do. Note:
Addition to reply #3.

In the designer, changed the background properties of the label to another color. Resulting in showing the label with correct textsize.
Basically same result as mentioned in first post.
 
Upvote 0
Top