Android Programming Press on the image to return to the main documentation page.

iTableView2

List of types:

TableCell
TableView

TableCell

Represents a single item in a TableView.

Events:

None

Members:


  ACCESSORY_CHECKMARK As Int [read only]

  ACCESSORY_DETAIL_BUTTON As Int [read only]

  ACCESSORY_DISCLOSURE_BUTTON As Int [read only]

  ACCESSORY_INDICATOR As Int [read only]

  ACCESSORY_NONE As Int [read only]

  AccessoryType As Int

  AddActionButton (Text As String, Color As Int)

  Bitmap As Bitmap

  ClearActionButtons

  CustomView As PanelWrapper

  DetailText As AttributedString

  IndentationLevel As Int

  IndentationWidth As Float

  InitializeSingleLine (Text As String)

  InitializeTwoLines (Text As String, DetailText As String)

  ShowSelection As Boolean

  Tag As Object

  Text As AttributedString

  Update

Members description:

ACCESSORY_CHECKMARK As Int [read only]
Shows a check mark. This symbol does not track touch events.
ACCESSORY_DETAIL_BUTTON As Int [read only]
Shows an info button. This symbol does track touch events.
ACCESSORY_DISCLOSURE_BUTTON As Int [read only]
Shows a chevron image with an info button. This symbol does track touch events.
ACCESSORY_INDICATOR As Int [read only]
Shows a chevron symbol (arrow). This accessory symbol does not track touch events.
ACCESSORY_NONE As Int [read only]
No accessory view.
AccessoryType As Int
Gets or sets the accessory symbol that shows at the right side of the cell.
AddActionButton (Text As String, Color As Int)
Adds an action button. The button will be displayed when the user swipes the item.
The TableView_ActionButtonClicked event will be raised when the button is clicked.
Bitmap As Bitmap
Gets or sets the item bitmap.
ClearActionButtons
Removes the action buttons from the button.
CustomView As PanelWrapper
The Panel together with its child views will be added to the cell.
Usually you will also need to set the table RowHeight and set the Panel's width and height.
DetailText As AttributedString
Gets or sets the second line attributed string.
IndentationLevel As Int
Gets or sets the indentation level. Default value is 0.
IndentationWidth As Float
Gets or sets the indentation width. Default value is 10 pixels (points).
InitializeSingleLine (Text As String)
Initializes a single line item with the given text.
InitializeTwoLines (Text As String, DetailText As String)
Initializes a two lines item with the given texts.
ShowSelection As Boolean
Gets or sets whether the item will be highlighted when selected. Default value is True.
Tag As Object
Gets or sets a tag object that is tied to this cell.
Text As AttributedString
Gets or sets the main text attributed string.
Update
Applies any changes done to visible cell. You should call this method after you update one or more properties
of an existing cell.

TableView

TableView shows a list of items (cells).
The TableView is divided into one or more sections.
TableView reuses the cells views and only updates the content. TableView can show very large lists.
TableView2 which adds support for action buttons, requires iOS 8+.

Events:

SelectedChanged (SectionIndex As Int, Cell As TableCell)
AccessoryButtonClicked (SectionIndex As Int, Cell As TableCell)
ActionButtonClicked (SectionIndex As Int, Cell As TableCell, Text As String)
Click
LongClick

Members:


  AddSection (Header As String, Footer As String)

  AddSingleLine (Text As String) As TableCell

  AddTwoLines (Text As String, DetailText As String) As TableCell

  Alpha As Float

  BaseView As ViewWrapper [read only]

  BeginUpdates

  BringToFront

  Clear

  Color As Int

  DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)

  EndUpdates

  GetItems (SectionIndex As Int) As List

  Height As Float

  Initialize (EventName As String, Grouped As Boolean)

  InsertCells (SectionIndex As Int, RowIndex As Int, Cells As List)

  IsFocused As Boolean [read only]

  IsInitialized As Boolean

  Left As Float

  NumberOfSections As Int [read only]

  ReloadAll

  ReloadSection (SectionIndex As Int)

  RemoveCells (SectionIndex As Int, StartRowIndex As Int, Count As Int)

  RemoveViewFromParent

  RequestFocus As Boolean

  ResignFocus As Boolean

  RowHeight As Float

  SCROLL_BOTTOM As Int [read only]

  SCROLL_MIDDLE As Int [read only]

  SCROLL_TOP As Int [read only]

  ScrollTo (SectionIndex As Int, RowIndex As Int, ScrollPosition As Int)

  SelectedRow As TableCell [read only]

  SelectedSection As Int [read only]

  SendToBack

  SeparatorColor As Int

  SetAlphaAnimated (DurationMS As Int, Alpha As Float)

  SetBorder (Width As Float, Color As Int, CornerRadius As Float)

  SetColorAnimated (DurationMS As Int, BackgroundColor As Int)

  SetLayoutAnimated (DurationMS As Int, DumpingRatio As Float, Left As Float, Top As Float, Width As Float, Height As Float)

  SetParallaxEffect (Vertical As Int, Horizontal As Int)

  SetSelection (SectionIndex As Int, RowIndex As Int)

  SetShadow (Color As Int, OffsetX As Float, OffsetY As Float, Opacity As Float, StaticRect As Boolean)

  SizeToFit

  Tag As Object

  TintColor As Int

  Top As Float

  UserInteractionEnabled As Boolean

  Visible As Boolean

  Width As Float

Members description:

AddSection (Header As String, Footer As String)
Adds a section to the TableView with the given header title and footer title.
AddSingleLine (Text As String) As TableCell
Adds a single line item to the TableView. This method returns a TableCell object which you can further modify.
AddTwoLines (Text As String, DetailText As String) As TableCell
Adds a two lines item to the TableView. This method returns a TableCell object which you can further modify.
Alpha As Float
Gets or sets the view's alpha level. 0 - transparent, 1 (default) - fully opaque.
BaseView As ViewWrapper [read only]
When the TableView is added as a custom view (from the designer) it is added to a base panel.
This property will return the base panel. You can use this property to move the TableView.
Note that if the view was added by code then this property will return the TableView itself.
BeginUpdates
Call this method before you call InsertCells or RemoveCells. You must call EndUpdates at the end.
BringToFront
Brings the view to front.
Clear
Removes all items from the TableView.
Color As Int
Gets or sets the view's background color.
DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
EndUpdates
Ends an updates block that was previously started with BeginUpdates.
GetItems (SectionIndex As Int) As List
Returns a List with the TableCells in the specified index.
Modifying this list will affect the items in this section. You should call TableView.ReloadSection if you have added or removed items.
Height As Float
Gets or sets the view's height.
Initialize (EventName As String, Grouped As Boolean)
Initializes the TableView.
EventName - Set the subs that will handle the events.
Grouped - Whether to use the grouped style or the plain style. The plain style uses floating headers.
InsertCells (SectionIndex As Int, RowIndex As Int, Cells As List)
This method should only be called after BeginUpdates was called.
Inserts one or more cells in the list. You do not need to call ReloadSection to apply the changes.
SectionIndex - The section index.
RowIndex - The first item will be added at this index.
Cells - A list with TableCells.
IsFocused As Boolean [read only]
Returns true if the view is focused.
IsInitialized As Boolean
Tests whether this object was initialized.
Left As Float
Gets or sets the view's left position.
NumberOfSections As Int [read only]
Returns the number of sections added to the TableView.
ReloadAll
Reloads all the TableCell data.
ReloadSection (SectionIndex As Int)
Reloads the data of a specific section. You should call this method if you have added or removed items from this section.
RemoveCells (SectionIndex As Int, StartRowIndex As Int, Count As Int)
This method should only be called after BeginUpdates was called.
Removes one or more cells from list. You do not need to call ReloadSection to apply the changes.
SectionIndex - The section index.
StartRowIndex - Index of the first item that will be removed.
Count - Number of items to remove.
RemoveViewFromParent
Removes the view from its parent (same as B4A View.RemoveView method).
RequestFocus As Boolean
Tries to set the focus on the current view. Returns True if the focus was set. Most views are not focusable.
When a text view is focused the keyboard is shown.
ResignFocus As Boolean
Removes the focus from the current view. Removing the focus from a text view will hide the keyboard.
RowHeight As Float
Gets or sets the rows heights.
SCROLL_BOTTOM As Int [read only]
SCROLL_MIDDLE As Int [read only]
SCROLL_TOP As Int [read only]
ScrollTo (SectionIndex As Int, RowIndex As Int, ScrollPosition As Int)
Scrolls the table to the given section and row index.
ScrollPosition - One of the SCROLL constants. This item will be scrolled to this position.
SelectedRow As TableCell [read only]
Returns the selected row item. Return Null if there is no selected row.
SelectedSection As Int [read only]
Returns the index of the section that holds the selected item. Returns -1 if there is no selected item.
SendToBack
Sends the view to the back.
SeparatorColor As Int
Gets or sets the separator color.
SetAlphaAnimated (DurationMS As Int, Alpha As Float)
Animates the view's alpha level.
DurationMS - Animation duration measured in milliseconds.
Alpha - The new alpha level (0 - transparent, 1 - fully opaque).
SetBorder (Width As Float, Color As Int, CornerRadius As Float)
Sets the view's border width, color and corner radius.
Note that the corner radius should be 0 if the view should show a shadow as well.
SetColorAnimated (DurationMS As Int, BackgroundColor As Int)
Animates the view's background color.
DurationMS - Animation duration measured in milliseconds.
BackgroundColor - The new background color.
Note that Labels do not support this type of animation.
SetLayoutAnimated (DurationMS As Int, DumpingRatio As Float, Left As Float, Top As Float, Width As Float, Height As Float)
Animates the view's layout.
DurationMS - Animation duration measured in milliseconds. Set to 0 to change the layout immediately.
DumpingRatio - If smaller than 1 then a spring effect will be applied to the animation. The minimum value should be 0.1.
Set to 1 for no spring effect.
Left, Top, Width and Height - The new layout.
SetParallaxEffect (Vertical As Int, Horizontal As Int)
Adds a parallax effect to the view. The view will slightly move when the device is tilted.
Vertical - Vertical offset. Can be a positive or negative value.
Horizontal - Horizontal offset. Can be a positive or negative value.
SetSelection (SectionIndex As Int, RowIndex As Int)
Sets the selected item and scrolls to this item.
SectionIndex - The item section index (o if there is only a single section).
RowIndex - The index of the item in the section. Pass -1 to deselect the current selected item.
SetShadow (Color As Int, OffsetX As Float, OffsetY As Float, Opacity As Float, StaticRect As Boolean)
Adds a shadow to to the view. The border corners radius should be set to 0 when adding shadows.
Colors - The shadow color.
OffsetX, OffsetY - The horizontal and vertical offsets.
Opacity - Sets the shadow opacity: 0 - transparent, 1 - opaque.
StaticRect - (optimization parameter) Set this parameter to True if the view's size is constant.
SizeToFit
Resizes the view to make it fit its content.
Tag As Object
Gets or sets the Tag object. This is a placeholder for any object you like to tie to this object.
TintColor As Int
Gets or sets the view's tint color. Some views use this color to change their appearance.
Top As Float
Gets or sets the view's top position.
UserInteractionEnabled As Boolean
Gets or sets whether the user can interact with this view. True by default.
Visible As Boolean
Gets or sets whether the view is visible.
Width As Float
Gets or sets the view's width.
Top