我有一个运行良好的TabBarController
应用程序,DialogViewController
除了在初始加载时表格为空,直到我触摸它或导航到另一个选项卡并返回(http://cl.ly/3I0r1v2b420t0L1X1h2w)。
我已确认Root
已设置。我试过发出一个ReloadData()
之后。我也试过TableView.Source
直接设置。在任何情况下,TableView
直到发生另一个动作,它才会显示任何内容。
这发生在模拟器和 iPhone 上。
知道为什么会这样吗?
public partial class PapersView : DialogViewController
{
public PapersView () : base (UITableViewStyle.Plain, null, true)
{
EnableSearch = true;
AutoHideSearch = true;
SearchPlaceholder = @"Find Papers";
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
MonoTouch.UIKit.UIApplication.SharedApplication.NetworkActivityIndicatorVisible = true;
var svc = new PaperService ();
svc.GetPapers (onPapersReceived, onErrorReceived);
}
private void onErrorReceived (string error)
{
MonoTouch.UIKit.UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false;
}
private void onPapersReceived (List<PaperNode> papers)
{
MonoTouch.UIKit.UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false;
Root = new RootElement ("Papers") {
from node in papers
group node by (node.paper.title [0].ToString ().ToUpper ()) into alpha
orderby alpha.Key
select new Section (alpha.Key){
from eachNode in alpha
select (Element)new WhitePaperBible.iOS.UI.CustomElements.PaperElement (eachNode)
}};
TableView.ScrollToRow (NSIndexPath.FromRowSection (0, 0), UITableViewScrollPosition.Top, false);
}
}