Note that there are some explanatory texts on larger screens.

plurals
  1. POMonotouch: how to optimize the performance for manual load the NIB
    primarykey
    data
    text
    <p>I use the scrollview to display multipage view, which have more than 10 pages. (scrollview.PageEnabled=true)</p> <p>And every single page in scrollview has about 6 sub-view(named:ABCUI) which every one is loaded from nib :</p> <pre><code> this.scrollview.DecelerationEnded+= scrollView_DecelerationEnded(...); public void LoadSubView(int nPageNo) { if (this.PageLoaded(nPageNo)) return; for (int i=0;i&lt;6;i++) { ABCViewController abcUI=MonoTouch.Foundation.NSBundle.MainBundle.LoadNib ("ABCUI", this, null); //XIB file size: 20K abcui.SetTitle(...); abcui.SetXXXX(...); abcui.frame = .. pageFrame.X += this.ScrollView.Frame.Width+nPage*...; this.scrollview.addsubview(abcUI.view,...); } } public void scrollView_DecelerationEnded (object sender, EventArgs e) { int nPageNo=(int)Math.Ceiling((this.ScrollView.ContentOffset.X+1)/this.ScrollView.Frame.Width); this.LoadSubView(nPageNo +1); this.LoadSubView(nPageNo - 1); } public void Button1Clicked(object sender, EventArgs e) { this.ClearViewsInScrollView(); this.LoadSubView(1); } </code></pre> <p>When the user trigger the button1 click, it will load the first page into scrollview(only 1 page oncetime, but 1 page has 6 sub-view), and when user scroll the scrollview , it will load the next page. </p> <p>But it will take a long time when load the first page or switch page in scrollview , so the user must waiting:</p> <ol> <li>ipad1: about 1000ms </li> <li>iPad2: about 600ms</li> <li>in simulator: 100ms;</li> </ol> <p>how to optimize the performance(reduce to less 300ms/ipad1)?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload