thanks, work fineCheck this:
Get size of system-font in use
The other day I received a report (along with screenshots) from a user saying that certain labels on his Galaxy S3 were truncated or simply did not show up correctly. I found this rather odd since my developer-phone is also a Galaxy S3 and of course I had made sure that everything (my layouts)...www.b4x.com
I hope I am understanding the question. If not, clarify what you see and what you want to see with code and screenshotbut for b4xtable cell?
Dim xfont As B4XFont=xui.CreateFont(Typeface.DEFAULT, 18/access.GetUserFontScale) 'reset font to default after user changed accessinility
B4XTable1.LabelsFont = xfont
work fine for row, but the header, page and search not changedI hope I am understanding the question. If not, clarify what you see and what you want to see with code and screenshot
'the 2 lines must be set before defining table columnsB4X:Dim xfont As B4XFont=xui.CreateFont(Typeface.DEFAULT, 18/access.GetUserFontScale) 'reset font to default after user changed accessinility B4XTable1.LabelsFont = xfont
B4XTable1.HeaderFont = xcode
For the header labels use this:work fine for row, but the header, page and search not changed
Dim xfontH As B4XFont=xui.CreateFont(Typeface.DEFAULT_BOLD, 18/access.GetUserFontScale) 'reset font to default after user changed accessinility
B4XTable1.HeaderFont = xfontH
B4XTable1.SearchField.TextField.Font = xui.CreateFont(Typeface.DEFAULT, 16/access.GetUserFontScale)
i have noticed that the font of AcToolbarLight is reduced each times that i go to into activity.Check this:
Get size of system-font in use
The other day I received a report (along with screenshots) from a user saying that certain labels on his Galaxy S3 were truncated or simply did not show up correctly. I found this rather odd since my developer-phone is also a Galaxy S3 and of course I had made sure that everything (my layouts)...www.b4x.com
header doesn't work. And search font?For the header labels use this:
For the search field use this code. For this, you need to put is after the columns were defined not before.:B4X:Dim xfontH As B4XFont=xui.CreateFont(Typeface.DEFAULT_BOLD, 18/access.GetUserFontScale) 'reset font to default after user changed accessinility B4XTable1.HeaderFont = xfontH
Please be more clear and give more details and code to help us help you, if you need additional helpB4X:B4XTable1.SearchField.TextField.Font = xui.CreateFont(Typeface.DEFAULT, 16/access.GetUserFontScale)
They need to be placed in the correct place in the code. I tested them on my B4XTble and they work. The header code has to be before you assign the B4XTable columns, for the search it is after. If you want to attach a project, provided no sensitive data. some of the members including myself will take a look, or you can show with code where you placed these lines in the code.header doesn't work. And search font?
Devono essere inseriti nella posizione corretta nel codice. Li ho testati sul mio B4XTble e funzionano. Il codice dell'intestazione deve essere prima di assegnare le colonne B4XTable, per la ricerca è dopo. Se vuoi allegare un progetto, non fornire dati sensibili. alcuni dei membri incluso me daranno un'occhiata, oppure puoi mostrare con il codice dove hai inserito queste righe nel codice.
W enza Ripristino AccessibilyFont:
B4XTable1.HeaderFont = xui.CreateDefaultBoldFont(24) 'intestazione
Con il ripristino di AccessibilyFont:
Dim xfontH As B4XFont=xui.CreateFont(Typeface.DEFAULT_BOLD, 24/access.GetUserFontScale) 'reimposta il carattere sui valori predefiniti dopo che l'utente ha cambiato accessinility
B4XTable1.HeaderFont = xfontH
View attachment 121174
View attachment 121173
java.lang.RuntimeException: Class instance was not initialized (b4xfloattextfield)
Sub Globals
Private B4XTable1 As B4XTable
Private StateColumn As B4XTableColumn
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim access As Accessibility
Dim xui As XUI
Activity.LoadLayout("main")
B4XTable1.Clear
' i have tied also here B4XTable1.SearchField.TextField.Font = xui.CreateFont(Typeface.DEFAULT, 6/access.GetUserFontScale)
B4XTable1.HeaderFont = xui.CreateFont(Typeface.DEFAULT_BOLD, 14/access.GetUserFontScale)
B4XTable1.MaximumRowsPerPage = 15
StateColumn = B4XTable1.AddColumn("Human", B4XTable1.COLUMN_TYPE_TEXT)
StateColumn.Width = 30%x
StateColumn = B4XTable1.AddColumn("Dog", B4XTable1.COLUMN_TYPE_TEXT)
StateColumn.Width = 30%x
StateColumn = B4XTable1.AddColumn("D1", B4XTable1.COLUMN_TYPE_TEXT)
StateColumn.Width = 30%x
StateColumn = B4XTable1.AddColumn("D2", B4XTable1.COLUMN_TYPE_TEXT)
StateColumn.Width = 30%x
StateColumn = B4XTable1.AddColumn("D3", B4XTable1.COLUMN_TYPE_TEXT)
StateColumn.Width = 30%x
' i have tied also here B4XTable1.SearchField.TextField.Font = xui.CreateFont(Typeface.DEFAULT, 6/access.GetUserFontScale)
B4XTable1.NumberOfFrozenColumns = 2
Dim data As List
data.Initialize
For i = 1 To 15
data.Add(Array("Mario Rossi", "Pluto", "5,5", "3", "2"))
Next
B4XTable1.SetData(data)
B4XTable1.LabelsFont = xui.CreateFont(Typeface.DEFAULT, 14/access.GetUserFontScale)
B4XTable1.SearchField.TextField.Font = xui.CreateFont(Typeface.DEFAULT, 6/access.GetUserFontScale)
'B4XTable1.Refresh
End Sub
Here is the complete corrected project. Tested and works after a slight tuning. You needed to check the B4X Views library in the IDE library pane. It was not checked. Also, you needed to add a Sleep(0) immediately after you load you main layout to allow an internal B4XTable layout to be loaded.but i have a error when set the search font
Sub Globals
Private B4XTable1 As B4XTable
Private StateColumn As B4XTableColumn
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim access As Accessibility
Dim xui As XUI
Activity.LoadLayout("main") 'You also need to check the B4X Views library
Sleep(0) 'Needed because of an internal layout has to be allowed to load first. Line Added by Mahares
B4XTable1.Clear
B4XTable1.HeaderFont = xui.CreateFont(Typeface.DEFAULT_BOLD, 14/access.GetUserFontScale)
B4XTable1.LabelsFont = xui.CreateFont(Typeface.DEFAULT, 14/access.GetUserFontScale)
B4XTable1.MaximumRowsPerPage = 15
StateColumn = B4XTable1.AddColumn("Human", B4XTable1.COLUMN_TYPE_TEXT)
StateColumn.Width = 30%x
StateColumn = B4XTable1.AddColumn("Dog", B4XTable1.COLUMN_TYPE_TEXT)
StateColumn.Width = 30%x
StateColumn = B4XTable1.AddColumn("D1", B4XTable1.COLUMN_TYPE_TEXT)
StateColumn.Width = 30%x
StateColumn = B4XTable1.AddColumn("D2", B4XTable1.COLUMN_TYPE_TEXT)
StateColumn.Width = 30%x
StateColumn = B4XTable1.AddColumn("D3", B4XTable1.COLUMN_TYPE_TEXT)
StateColumn.Width = 30%x
B4XTable1.SearchField.TextField.Font = xui.CreateFont(Typeface.DEFAULT, 6/access.GetUserFontScale)
B4XTable1.NumberOfFrozenColumns = 2
Dim data As List
data.Initialize
For i = 1 To 15
data.Add(Array("Mario Rossi", "Pluto", "5,5", "3", "2"))
Next
B4XTable1.SetData(data)
End Sub
There are several views in the header panel besides the search box text field. You have to go through all of them. As an example:Continue to doesn't work fine
B4XTable1.lblNumber.Font = xui.CreateFont(Typeface.DEFAULT, 14/access.GetUserFontScale) 'this is for the number showing as the page you are looking at
For Each v As B4XView In B4XTable1.pnlHeader.GetView(2).GetAllViewsRecursive
If v Is Label Then
Dim x As Label=v
x.TextSize=24/access.GetUserFontScale
' x.TextSize=24
End If
Next
For Each v As B4XView In B4XTable1.pnlHeader.GetAllViewsRecursive
If v.Tag Is B4XFloatTextField Then
Dim y As B4XFloatTextField =v.tag
y.HintFont= xui.CreateFont(Typeface.DEFAULT,20/access.GetUserFontScale)
' y.HintFont= xui.CreateFont(Typeface.DEFAULT,20)
y.LargeLabelTextSize=20/access.GetUserFontScale
' y.LargeLabelTextSize=20
y.Update
else if v Is Label Then
Dim x As B4XView=v
x.TextSize=20/access.GetUserFontScale
' x.TextSize=20
x.TextColor=xui.Color_Blue
else if v Is Panel Then
Dim z As B4XView =v
z.Color =xui.Color_Cyan
End If
Next
Ci sono diverse visualizzazioni nel pannello dell'intestazione oltre al campo di testo della casella di ricerca. Devi passare attraverso tutti loro. Come esempio:
Ci sono altre viste come: : B4XTable1.SearchField.lblV, B4XTable1.SearchField.lblClear e altre come le frecce, ecc. che non ho guardato. A questo punto, puoi dare seguito e forse qualcuno può dare un'occhiata più approfondita all'accessibilità del tuo progetto. Potrebbe non essere male aggiungere questo alla fine: B4XTable1.SearchField.UpdateB4X:B4XTable1.lblNumber.Font = xui.CreateFont(Typeface.DEFAULT, 14/access.GetUserFontScale) 'questo è per il numero mostrato come pagina che stai guardando
Ecco tutte le gerarchie delle viste nel layout nascosto di B4XTable
L'ho aggiunto pochi minuti dopo come esempio per le etichette all'interno di un pannello (PnlPages) che si trova all'interno di pnlHeader. Puoi provarlo. Riduce le dimensioni::
[codice]Per ogni v Come B4XView in B4XTable1.pnlHeader.GetView(2).GetAllViewsRecursive
Se v è etichetta allora
Dim x As Label=v
x.TextSize=24/access.GetUserFontScale
' x.TextSize=24
Finisci se
Avanti[/codice]
View attachment 121824
[codice][/codice]