Difference between revisions of "iOSMobileTable"

From Xojo Documentation

Line 31: Line 31:
 
{{Method | name=AddRow | description=AddRow(section As Integer, value As String)
AddRow(section As Integer, value As MobileTableCellData)
AddRow(value As String)
Adds a row to the table with the value passed in (optionally) the section passed.}}
 
{{Method | name=AddRow | description=AddRow(section As Integer, value As String)
AddRow(section As Integer, value As MobileTableCellData)
AddRow(value As String)
Adds a row to the table with the value passed in (optionally) the section passed.}}
 
{{Method | name=AddRowAt | description=AddRowAt(section As Integer, index As Integer)
AddRowAt(section As Integer, index As Integer, cell As MobileTableCellData)
AddRowAt(section As Integer, index As Integer, value As String)
Adds a row to the table at the specified section and index.}}
 
{{Method | name=AddRowAt | description=AddRowAt(section As Integer, index As Integer)
AddRowAt(section As Integer, index As Integer, cell As MobileTableCellData)
AddRowAt(section As Integer, index As Integer, value As String)
Adds a row to the table at the specified section and index.}}
{{Method | name=AddSection | description=AddSection(title As String = "")
Adds a section, with the optional title, to the table.
AddSection(title As String = "") As Integer
Adds a section, with the optional title, to the table and returns the index number for the new section.}}
+
{{Method | name=AddSection | description=AddSection(title As String)
Adds a section, with the optional title, to the table.
AddSection(title As String) As Integer
Adds a section, with the optional title, to the table and returns the index number for the new section.}}
 
{{Method | name=AddSectionAt | description=AtSectionAt(index As Integer)
Adds a section at the index passed.
AddSectionAt(index As Integer, title As String)
Adds a section with the title passed at the index passed.}}
 
{{Method | name=AddSectionAt | description=AtSectionAt(index As Integer)
Adds a section at the index passed.
AddSectionAt(index As Integer, title As String)
Adds a section with the title passed at the index passed.}}
{{Method | name=CreateCell | description=CreateCell(value As String = "", detail As String = "", image As Picture = Nil, accessory As MobileTableCellData.AccessoryTypes = MobileTableCellData.AccessoryTypes.None) As MobileTableCellData
Creates a standard table cell, optionally pre-populating its properties with the specified arguments.}}
+
{{Method | name=CreateCell | description=CreateCell(value As String, detail As String, image As Picture = Nil, accessory As MobileTableCellData.AccessoryTypes = MobileTableCellData.AccessoryTypes.None) As MobileTableCellData
Creates a standard table cell, optionally pre-populating its properties with the specified arguments.}}
 
{{Method | name=CreateCustomCell | description=CreateCustomCell(controlClass As Xojo.Introspection.TypeInfo) As MobileTableCellData
Creates or reuses a table cell that uses a custom control. If there is no view to reuse, the cell's control will be instantiated from the passed type information.}}
 
{{Method | name=CreateCustomCell | description=CreateCustomCell(controlClass As Xojo.Introspection.TypeInfo) As MobileTableCellData
Creates or reuses a table cell that uses a custom control. If there is no view to reuse, the cell's control will be instantiated from the passed type information.}}
 
{{Method | name=EndRefresh | description=EndRefresh
Call this method when you have finished updating data (in the Refreshed event) to close the pull-to-refresh UI.}}
 
{{Method | name=EndRefresh | description=EndRefresh
Call this method when you have finished updating data (in the Refreshed event) to close the pull-to-refresh UI.}}

Revision as of 23:48, 26 March 2021

Class (inherits from MobileUIControl)

New in 2020r2

An iOSTable is used for displaying a list of data.

Constructors

Constructor(format As Formats)


Enumerations
Formats RowEditingStyles ScrollPositions
Events
AccessoryPressed Closing RowActionSelected
ApplyActionsForRow Opening SearchChanged
ApplyRowEditingStyle Refreshed SelectionChanged
Methods
AddConstraint CreateCustomCell RemoveRowAt
AddControl EndRefresh RemoveSectionAt
AddRow Refresh RowCellData
AddRowAt ReloadDataInSection RowCount
AddSection ReloadDataSource ScrollToRow
AddSectionAt ReloadRow SearchControllerHandle
ClearFocus RemoveAllRows SectionTitleAt
ControlAt RemoveConstraint SelectRow
CreateCell RemoveControl SetFocus
Properties
AccessibilityHint EstimatedRowHeight SectionCount fa-lock-32.png
AccessibilityLabel Format fa-lock-32.png SelectedRow fa-lock-32.png
AllowRefresh Height fa-lock-32.png Top fa-lock-32.png
AllowSearch Left fa-lock-32.png Visible
DataSource Name fa-lock-32.png Width fa-lock-32.png
EditingEnabled Parent fa-lock-32.png

Notes

An iOSMobileTable has only a single column of cells so by default it can only show one column of data. Use MobileTableCustomCell to create your own cells with your own cell layout. This allows you to have a cell with its own controls or even multiple columns.

A table can have data added to it in one of two ways: manually or from a data source. Some methods only work with data that was added manually, some methods only work with data added using a data source. If you are adding many rows (100+), you should instead use an iOSMobileTableDataSource for better performance and reduced memory usage.

A table must have at least one section (0-based). If there is only one section, then the section title does not appear in the table.

Sample Code

Add five rows to a table:

// Simple usage
Table1.AddSection("")
For i As Integer = 0 To 4
Table1.AddRow(0, "Row " + i.ToString)
Next

See Also

MobileTableCustomCell control; MobileTableCellData, iOSMobileTableRowAction classes; iOSMobileTableDataSource, iOSMobileTableDataSourceEditing, iOSMobileTableDataSourceReordering interfaces; UserGuide:iOS_Table topic