2016-08-16 12 views
8

ने एक परिपत्र प्रगति पट्टी बनाई जो एनीमेशन के साथ ठीक काम कर रहा है। लेकिन गतिशील डेटा प्रगति पट्टी का उपयोग करके इसे प्रदर्शित करने का प्रयास करते समय अद्यतन नहीं हो रहा है।सी # xamarin परिपत्र प्रगति पट्टी - एंड्रॉइड

कोड नीचे

progrssBarObj = FindViewById<ProgressBar>(Resource.Id.progressBarSync); 

    ObjectAnimator animation = ObjectAnimator.OfInt(progrssBarObj, "progress", 0, 100); // see this max value coming back here, we animale towards that value 
    animation.SetDuration(3000); //in milliseconds 
    animation.SetInterpolator(new DecelerateInterpolator()); 
    animation.Start(); 

काम कर रहा है और AXML कोड

<ProgressBar 
      style="?android:attr/progressBarStyleHorizontal" 
      android:layout_column="2" 
      android:id="@+id/progressBarSync" 
      android:layout_width="300dp" 
      android:layout_height="300dp" 
      android:progressDrawable="@drawable/circular_progress_bar" 
      android:background="@drawable/progress_bar_background" /> 

है लेकिन प्रगति बार डेटा के साथ अद्यतन करने नहीं है जब मैं पाश में की तरह कुछ करने की कोशिश की। मूल रूप से प्रगति पट्टी सर्कल में अद्यतन नहीं हो रही है।

  for (int i = 0; i <= 100; i++) 
      { 
       int cnt = 0; 
       cnt = cnt + i; 
       progrssBarObj.Progress = cnt; 

      } 

किसी भी मदद की सराहना की जाएगी।

उत्तर

6

मैं नया कार्य में अंदर पाश के लिए रखा जाता है और यह

await Task.Run(() => 
{ 
    for (int i = 0; i < dtITM.Rows.Count; i++) 
    { 
    int cnt = 0; 
    cnt = cnt + i; 
    progrssBarObj.Progress = cnt; 
    } 
} 
काम किया गया
संबंधित मुद्दे