本文整理汇总了C#中UITableView.ReloadData方法的典型用法代码示例。如果您正苦于以下问题:C# UITableView.ReloadData方法的具体用法?C# UITableView.ReloadData怎么用?C# UITableView.ReloadData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UITableView
的用法示例。
在下文中一共展示了UITableView.ReloadData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
this.Title = "Conferences";
View = new UIView(UIScreen.MainScreen.Bounds) { BackgroundColor = UIColor.White };
TableView = new UITableView(UIScreen.MainScreen.Bounds);
var source = new MvxStandardTableViewSource(
TableView,
UITableViewCellStyle.Subtitle,
CellIdentifier,
"TitleText Name; DetailText Start",
UITableViewCellAccessory.DisclosureIndicator
);
TableView.Source = source;
var set = this.CreateBindingSet<ConferencesView, ConferencesViewModel>();
set.Bind(source).To(vm => vm.Conferences);
//TODO : Add SelectionChangedCommand binding
set.Bind(source).For(s => s.SelectionChangedCommand).To(vm => vm.ShowConferenceCommand);
set.Apply();
TableView.ReloadData();
}
示例2: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
View = new UIView() { BackgroundColor = UIColor.White };
if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
EdgesForExtendedLayout = UIRectEdge.None;
TableView = new UITableView(UIScreen.MainScreen.Bounds);
var source = new MvxStandardTableViewSource(
TableView,
UITableViewCellStyle.Subtitle,
CellIdentifier,
"TitleText Title; DetailText Start"
);
TableView.Source = source;
var set = this.CreateBindingSet<ConferenceView, ConferenceViewModel>();
set.Bind(source).To(vm => vm.Sessions);
set.Apply();
TableView.ReloadData();
}
示例3: ReloadData
public void ReloadData(UITableView tableView, IEnumerable<Core.Model.DrugInfo> drugInformation)
{
DrugInformation.Clear();
DrugInformation.AddRange(drugInformation);
tableView.ReloadData();
}
示例4: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
var table = new UITableView (new CoreGraphics.CGRect (0f, 20f, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height)); // defaults to Plain style
quotes.Add(new Quote("列表", "向右慢拉返回", ""));
quotes.Add(new Quote("", "Loading...", ""));
table.Source = new QuoteTableSource (quotes);
UISwipeGestureRecognizer swipeGestureRecognizerRight = new UISwipeGestureRecognizer (() => {
DismissViewController(true, null);
}){
Direction = UISwipeGestureRecognizerDirection.Right
};
this.View.AddGestureRecognizer (swipeGestureRecognizerRight);
Thread thread = new Thread(() => {
update(location, model);
InvokeOnMainThread(delegate {
table.ReloadData();
});
});
thread.Start ();
Add (table);
}
示例5: RefreshData
public void RefreshData(UITableView tableview, IEnumerable<MonkeyInformation> updatedMonkeyInfo)
{
this.monkeyInformation.Clear();
this.monkeyInformation.AddRange(updatedMonkeyInfo);
BeginInvokeOnMainThread(() => tableview.ReloadData());
}
示例6: CustomSearchController
public CustomSearchController (ViewController owner, UISearchBar searchBar, UITableView searchPredictionTable, List<Room> rooms)
{
_searchBar = searchBar;
_searchPredictionTable = searchPredictionTable;
owner.InvokeOnMainThread (delegate() {
_searchPredictionTable.Alpha = 0;
});
tableSource = new TableSource (owner, rooms);
_searchPredictionTable.Source = tableSource;
_searchBar.TextChanged += (sender, e) => {
owner.InvokeOnMainThread (delegate() {
tableSource.tableItems = rooms.FindAll ((room) => room.Name.ToLower().Contains (e.SearchText.ToLower())).ToArray ();
_searchPredictionTable.ReloadData();
});
};
_searchBar.CancelButtonClicked += (sender, e) => {
_searchBar.ShowsCancelButton = false;
_searchBar.ResignFirstResponder();
};
_searchBar.OnEditingStarted += (sender, e) => {
_searchBar.ShowsCancelButton = true;
_searchPredictionTable.Alpha = 1;
};
_searchBar.OnEditingStopped += (sender, e) => {
_searchPredictionTable.Alpha = 0;
_searchBar.ResignFirstResponder ();
};
}
示例7: ViewDidLoad
public override void ViewDidLoad()
{
View = new UIView(){ BackgroundColor = UIColor.White};
base.ViewDidLoad();
// ios7 layout
if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
EdgesForExtendedLayout = UIRectEdge.None;
var textField = new UITextField(new RectangleF(10, 10, 300, 40));
Add(textField);
var tableView = new UITableView(new RectangleF(0, 50, 320, 500), UITableViewStyle.Plain);
Add(tableView);
// choice here:
//
// for original demo use:
// var source = new MvxStandardTableViewSource(tableView, "TitleText");
//
// or for prettier cells from XIB file use:
// tableView.RowHeight = 88;
// var source = new MvxSimpleTableViewSource(tableView, BookCell.Key, BookCell.Key);
tableView.RowHeight = 88;
var source = new MvxSimpleTableViewSource(tableView, BookCell.Key, BookCell.Key);
tableView.Source = source;
var set = this.CreateBindingSet<FirstView, Core.ViewModels.FirstViewModel>();
set.Bind(textField).To(vm => vm.SearchTerm);
set.Bind(source).To(vm => vm.Results);
set.Apply();
tableView.ReloadData();
}
示例8: CommitEditingStyle
public async override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
{
if (editingStyle == UITableViewCellEditingStyle.Delete) {
var selectedObject = controller.DataSource.Objects.ElementAtOrDefault (indexPath.Row);
try
{
RootViewController.SetLoadingState(true);
var deleted = await controller.Client.DeleteAsync (selectedObject);
if (deleted)
objects.Remove (selectedObject);
}
catch (InsufficientRightsException)
{
ShowInsuffientRightsMessage (tableView);
}
catch (DeleteFailedException ex)
{
ShowDeleteFailedMessage (tableView, ex);
}
finally
{
RootViewController.SetLoadingState(false);
tableView.ReloadData ();
}
}
}
示例9: WillDisplay
/// <summary>
/// Wills the display load new items on scrolling down.
/// </summary>
/// <param name="tableView">Table view.</param>
/// <param name="cell">Cell.</param>
/// <param name="indexPath">Index path.</param>
public override async void WillDisplay (UITableView tableView, UITableViewCell cell, NSIndexPath indexPath)
{
if (indexPath.Row == tableItems.Count - 1) {
owner.PageIndex = ++ owner.PageIndex ;
//Reload your data here
var newitems = await owner.PopulateClassifieds();
tableItems.AddRange(newitems);
tableView.ReloadData ();
}
}
示例10: RowSelected
public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
{
var request = new RestRequest ();
var tab = (MainTabController)UIApplication.SharedApplication.Delegate.Window.RootViewController;
if (indexPath.Row == 0 && !root) {
request.RequestFinished += (object sender, RequestEndedArgs e) => {
InvokeOnMainThread(delegate {
var data = (List<LiveScoreSportModel>)JsonConvert.DeserializeObject(e.Result, typeof(List<LiveScoreSportModel>));
tableView.Source = new SwitchCategorySource(data, target);
tableView.ReloadData();
});
};
request.Send (RequestConfig.LiveScoreSports, "GET");
var request2 = new RestRequest ();
request2.RequestFinished += (object sender, RequestEndedArgs e) => {
InvokeOnMainThread(delegate {
var data = (LiveScoreViewModel)JsonConvert.DeserializeObject(e.Result, typeof(LiveScoreViewModel));
this.target.Source = new TodayTableSource(data);
this.target.ReloadData();
});
};
request2.Send (string.Format (RequestConfig.LiveScore, categories [indexPath.Row].Id, 0), "GET");
//tab.LiveScore.SportToday.Text = "All Sports";
}
else {
request.RequestFinished += (object sender, RequestEndedArgs e) => {
InvokeOnMainThread(delegate {
var data = (List<LiveScoreCategoryModel>)JsonConvert.DeserializeObject(e.Result, typeof(List<LiveScoreCategoryModel>));
data.Insert(0, new LiveScoreCategoryModel { Name = "Back" });
tableView.Source = new SwitchCategorySource(data, target, currentSport);
tableView.ReloadData();
});
};
var request2 = new RestRequest ();
request2.RequestFinished += (object sender, RequestEndedArgs e) => {
InvokeOnMainThread(delegate {
var data = (LiveScoreViewModel)JsonConvert.DeserializeObject(e.Result, typeof(LiveScoreViewModel));
this.target.Source = new TodayTableSource(data);
this.target.ReloadData();
});
};
if (root) {
request.Send (string.Format (RequestConfig.LiveScoreCategories, items [indexPath.Row].Id), "GET");
request2.Send (string.Format (RequestConfig.LiveScore, items[indexPath.Row].Id, 0), "GET");
//tab.LiveScore.SportToday.Text = items [indexPath.Row].Name;
}
else {
request2.Send (string.Format (RequestConfig.LiveScore, currentSport, categories [indexPath.Row].Id), "GET");
}
}
}
示例11: ViewDidLoad
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
View.BackgroundColor = UIColor.White;
table = new UITableView (new RectangleF (0, 110, View.Bounds.Width, View.Bounds.Height - 120));
table.AutoresizingMask = UIViewAutoresizing.All;
refreshButton = UIButton.FromType (UIButtonType.RoundedRect);
refreshButton.Frame = new RectangleF (230, 50, 80, 40);
refreshButton.SetTitle ("Refresh", UIControlState.Normal);
refreshButton.TouchUpInside += HandleRefreshTouchUpInside;
addPassButton = UIButton.FromType (UIButtonType.RoundedRect);
addPassButton.Frame = new RectangleF (10, 50, 80, 40);
addPassButton.SetTitle ("Add", UIControlState.Normal);
addPassButton.TouchUpInside += HandleAddTouchUpInside;
replacePassButton = UIButton.FromType (UIButtonType.RoundedRect);
replacePassButton.Frame = new RectangleF (100, 50, 80, 40);
replacePassButton.SetTitle ("Replace", UIControlState.Normal);
replacePassButton.TouchUpInside += HandleReplaceTouchUpInside;
passLibraryAvailableLabel = new UILabel (new RectangleF (10, 5, 300, 40));
passLibraryAvailableLabel.Text = "Pass Library Available: " + PKPassLibrary.IsAvailable.ToString ();
if (PKPassLibrary.IsAvailable) {
library = new PKPassLibrary ();
Console.WriteLine ("library.GetPasses");
var passes = library.GetPasses ();
table.Source = new TableSource (passes, library);
// Notification for changes to the library!
noteCenter = NSNotificationCenter.DefaultCenter.AddObserver (PKPassLibrary.DidChangeNotification, (not) => {
BeginInvokeOnMainThread (() => {
new UIAlertView("Pass Library Changed"
, "Notification Received", null, "OK", null).Show();
// refresh the list
var passlist = library.GetPasses ();
table.Source = new TableSource (passlist, library);
table.ReloadData ();
});
}, library); // IMPORTANT: must pass the library in
} else {
Console.WriteLine ("No Pass Kit - must be an iPad");
addPassButton.SetTitleColor (UIColor.LightGray, UIControlState.Disabled);
addPassButton.Enabled = false;
}
Add (table);
Add (passLibraryAvailableLabel);
Add (refreshButton);
Add (addPassButton);
Add (replacePassButton);
}
示例12: CommitEditingStyle
public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, MonoTouch.Foundation.NSIndexPath indexPath)
{
if(editingStyle == UITableViewCellEditingStyle.Delete)
{
CodeProjectMember memberToDelete = MemberList [indexPath.Row];
CodeProjectDatabase database = new CodeProjectDatabase ();
database.DeleteMember (memberToDelete.Id);
MemberList = database.GetMembers();
tableView.ReloadData ();
}
}
示例13: GetCell
/// <summary>
/// Gets the cell.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="reusableCell">The reusable cell.</param>
/// <param name="tv">The table view.</param>
/// <returns>UITableViewCell.</returns>
public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
{
var viewCell = item as CheckboxCell;
var nativeCell = base.GetCell(item, reusableCell, tv);
nativeCell.SelectionStyle = UITableViewCellSelectionStyle.None;
if (viewCell == null) return nativeCell;
nativeCell.Accessory = viewCell.Checked ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None;
viewCell.CheckedChanged += (s, e) => tv.ReloadData();
return nativeCell;
}
示例14: WillDisplay
public override void WillDisplay (UITableView tableView, UITableViewCell cell, NSIndexPath indexPath)
{
List<TableItem> tblitems ;
tblitems = new List<TableItem> {
new TableItem(){Heading="head head",SubHeading="sub",ImageName= "tab_feed.png" },
new TableItem(){Heading="head",SubHeading="sub",ImageName = "tab_feed.png"},
new TableItem(){Heading="head",SubHeading="sub",ImageName="tab_feed.png"},
};
if (indexPath.Row == tableItems.Count - 1) {
//Reload your data here
tableItems.AddRange(tblitems);
tableView.ReloadData ();
}
}
示例15: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
tableView = new UITableView {
TranslatesAutoresizingMaskIntoConstraints = false,
AllowsSelection = true,
SeparatorStyle = UITableViewCellSeparatorStyle.None,
};
tableView.BackgroundColor = new UIColor (1f,1f,1f,0.7f);
View.AddSubview (tableView);
RefreshControl = new UIRefreshControl ();
RefreshControl.ValueChanged += async (sender, args) =>
{
await LoadChurches ();
RefreshControl.EndRefreshing(); // Signal controller that we are done.
};
tableView.AddSubview (RefreshControl);
searchBarView = new UIView (new CGRect(0,64,320,30));
searchBar = new UISearchBar (new CGRect(0,0,320,30));
searchBar.Placeholder = "Enter a Church Name, City, or Zip Code";
searchBar.TextChanged += (sender, e) => {
//filter main list
_subChurches = prayerService.GlobalChurches
.Where(c=>c.Name.Contains(e.SearchText)
|| c.City.Contains(e.SearchText)
|| c.Zip.Contains(e.SearchText)
).ToList();
if (e.SearchText == default(string)) {
_subChurches = prayerService.GlobalChurches;
}
if (_subChurches.Count > 0){
tableView.Source = new ChurchSource(_subChurches,this,prayerService);
tableView.ReloadData();
}
};
View.AddSubview (searchBarView);
searchBarView.AddSubview (searchBar);
}