Upravit

Sdílet prostřednictvím


UITableView.SelectRow(NSIndexPath, Boolean, UITableViewScrollPosition) Method

Definition

Selects the given row, optionall scrolling the row to a specific location.

[Foundation.Export("selectRowAtIndexPath:animated:scrollPosition:")]
public virtual void SelectRow (Foundation.NSIndexPath indexPath, bool animated, UIKit.UITableViewScrollPosition scrollPosition);
abstract member SelectRow : Foundation.NSIndexPath * bool * UIKit.UITableViewScrollPosition -> unit
override this.SelectRow : Foundation.NSIndexPath * bool * UIKit.UITableViewScrollPosition -> unit

Parameters

indexPath
NSIndexPath

Identifies the row to be selected.

This parameter can be null.

animated
Boolean

true to animate the selection and position change, false if the change should occur immediately.

scrollPosition
UITableViewScrollPosition

Position that the selected row should be scrolled to (top, middle, bottom).

Attributes

Examples

Passing None. will result in no scrolling (despite that constant normally causing minimal scrolling). To scroll to the newly selected row with minimum scrolling, select the row using this method with None then call ScrollToRow(NSIndexPath, UITableViewScrollPosition, Boolean) also with None.

NSIndexPath rowToSelect; // assume this is valid
UITableView myTableView; // assume this is valid

myTableView.SelectRow (rowToSelect, true, UITableViewScrollPosition.None);
myTableView.ScrollToRow (rowToSelect, UITableViewScrollPosition.None, true);

Remarks

Calling this method does not trigger WillSelectRow(UITableView, NSIndexPath) nor will it send SelectionDidChangeNotification notifications.

Applies to