Is there a declare that anyone knows of that can be used to change the default highlight color of an iOSTable?
This appears to be the relevant documentation from the UIKit API, but I’m not savvy enough with declares to put it all together and access the selectionStyle property of the table cell.
I am using a table populated with iOSCustomTableCell objects.
Thanks for the reply Jrmie, that’s good information to know.
I think that I will approach this with a canvas as the background of the cell which I can draw into similar to desktop Xojo’s CellBackgroundPaint. I’ll save the index of the row that was selected, make the background canvas visible in the RowData method of the DataSource, and then call ReloadData on the table.
I gave that method a try as well, just to get some more iOS experience, but it appears that iOSTableCellData.Image draws on top the controls in the cell.
[quote]Instance Property: selected?Background?View
The view used as the background of the cell when it is selected.[/quote]
I can’t give you a Xojo-Declare (but I hope others here can), but it sure seems to be possible.
I use a global Public Property highlight_color as Color = &cFFFE0A00 and set that to a color for highlight
change &cFFFF660 to whatever color you need
Then in the Open Event of an IOSTable add this
Dim cellData As iOSTableCellData
cellData.SetSelectedBackgroundColorXC(highlight_color)
I am using Luna and use this in the returned data in PageReceived for a tables data needs. In that case I do not add to Open Event I add this in PageReceived
In this example I have a custom cell for each row
Full_Name_Table is the name of an iOSTable
PersonNameAddressCustomCell is iOSCustomTableCell with two iOSLabel and one iOSImageView
Then in PageReturn for this specific LUNA response I add this
Dim cellData As iOSTableCellData = Full_Name_Table.CreateCustomCell(GetTypeInfo(PersonNameAddressCustomCell))
Then this
cellData.SetSelectedBackgroundColorXC(highlight_color)
to set the highlight color