Hoping to get some ideas here.
I have a ListView with custom ViewCells. In the constructor of the ViewCell I create a progressbar and set IsVisible to false:
progressBar = new ProgressBar
{
IsVisible = false,
};
In the OnAppearing() method of the ViewCell, I check a condition and set the progressBar visibility to true:
if(conditiontrue)
progressBar.IsVisible = true;
When I run my application on an iOS device the progressBar doesn't appear consistently. Sometimes it shows up, and sometimes it doesn't. The condition always is successful, the line of code that sets visibility to true is reached, but the bar randomly doesn't show up. It works 100% on Android, no problems.
The list is long enough, so that I can scroll the affected cell off screen. When I scroll back the bar sometimes returns.
I've been trying some things, but I haven't been able to figure out an answer. I recently upgraded to Forms 1.4, and this problem started occurring after the upgrade.
Some other thoughts, info:
- Using 8.2 SDK, testing on a 5s device.
- Have cleaned the solution, restarted VS, restarted the machine, did all updates.
- No errors / warnings on build. No errors found in log when running.
- The progressBar is not a custom component, though I did try with BTProgressHUD with the same results.
- I tried removing everything else from the ViewCell, so that the progress bar is the only item, and I get the same results
- I thought that maybe it has to do with changing the visibility of the progress bar in the main UI thread so I tried wrapping the update code with Device.BeginInvokeOnMainThread, with no change. I assume OnAppearing is run on the main UI thread, but wasn't sure?
Device.BeginInvokeOnMainThread(() =>
{
progressBar.IsVisible = true;
});
Hoping that someone could give me some idea that might fix this?