In an app I am building I use the following pattern: If the user clicks on a hierarchical navigation element I open the next UIViewController
immediately, and it takes care about loading its data itself and shows a loading spinner if it is going over the network.
Now most list views are created using MonoTouch
. On one DialogViewController
I have an issue with adding many element to the views RootElement after the screen has already been show.
At first the StringElements
appear fine on screen, but if you scroll quickly up and down the text on each line becomes a block:
Code to reproduce the issue:
var root = new RootElement("Root");
var dvc = new DialogViewController(root) { AutoHideSearch = true, EnableSearch = true };
nav.PushViewController(dvc, true);
Task.Factory.StartNew(() => {
Thread.Sleep(TimeSpan.FromSeconds(1));
UIApplication.SharedApplication.InvokeOnMainThread(() => {
var sec = new Section();
for (int i = 0; i < 100; i++)
{
var el = new StyledStringElement("Test", "Test", UITableViewCellStyle.Value1);
sec.Add(el);
}
root.Add(sec);
});
});
Interestingly only the string on the left looks like a block, while the one on the right is fine. On a side note, in their MWC (demo) app, Xamarin created a new RootElement to repopulate the twitter list as well.