Difference between revisions of "iOSTableRowAction"

From Xojo Documentation

(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
| super=[[Object]]
| super=[[Object]]
Line 25: Line 26:
== Notes ==
== Notes ==
Row actions only work for tables that use iOSTableDataSourceEditing and where its RowIsEditable method returns True.
Row actions only work for tables that use [[iOSMobileTableDataSourceEditing]] and where its [[iOSMobileTableDataSourceEditing.AllowRowEditing|AllowRowEditing]] method returns [[True]].
== Sample Code ==
== Sample Code ==

Latest revision as of 21:09, 18 November 2020

Class (inherits from Object)

New in 2016r2

An iOSTableRowAction represents a single action that a user can take when swiping horizontally on an iOSTable row. Multiple actions may be added. As of iOS 8 an action is presented as a button near the trailing edge of the row. This class is used in conjunction with the iOSTable.ActionsForRow event.

Handle fa-lock-32.png Tag
Style fa-lock-32.png Title

Constructor(style As Styles, title As Text, Optional tag As Auto)


Row actions only work for tables that use iOSMobileTableDataSourceEditing and where its AllowRowEditing method returns True.

Sample Code

This class is used in the iOSTable.ActionsForRow event to set up the actions. The iOSTable.RowAction event is called when an action is used. This is how you would set it up in the iOSTable events:

Event ActionsForRow(section As Integer, row As Integer) As iOSTableRowActions()
Var actions(1) As iOSTableRowAction
' Create the More button
actions(0) = New iOSTableRowAction(iOSTableRowAction.Styles.Normal, "More...", "More")
' Create the Delete button
actions(1) = New iOSTableRowAction(iOSTableRowAction.Styles.Destructive, "Delete", "Delete")
Return actions
End Event

Event RowAction(section As Integer, row As Integer, actionTag As Auto)
Select actionTag
Case "More"
// ... show more info
Case "Delete"
// ... delete something
End Select
End Event

See Also