c# - Android ProgressBar in my View -
i trying place loading spinner canvas. in constructor:
this.progressbar = new progressbar(context, null, resource.attribute.progressbarstyle);
and in ondraw
:
protected override void ondraw(canvas canvas) { base.ondraw(canvas); // other code draw other stuff... this.progressbar.draw(canvas); }
it not appearing. missing something? checked width
property , 0 while debugging, still don't know how fix it.
my class extends view
you need extend class viewgroup or layout (e.g. framelayout), during initialization need call addview methods progress bar.
if extending simple viewgroup additionally need override onmeasure , onlayout methods providing computing size of progress widget , placing on view group accordingly.
here tutorial xamarin users more info.
Comments
Post a Comment