Beispiel #1
0
 /// <summary>Add a tab.</summary>
 /// <remarks>Add a tab.</remarks>
 /// <param name="tabSpec">Specifies how to create the indicator and content.</param>
 public virtual void addTab(android.widget.TabHost.TabSpec tabSpec)
 {
     if (tabSpec.mIndicatorStrategy == null)
     {
         throw new System.ArgumentException("you must specify a way to create the tab indicator."
                                            );
     }
     if (tabSpec.mContentStrategy == null)
     {
         throw new System.ArgumentException("you must specify a way to create the tab content"
                                            );
     }
     android.view.View tabIndicator = tabSpec.mIndicatorStrategy.createIndicatorView();
     tabIndicator.setOnKeyListener(mTabKeyListener);
     // If this is a custom view, then do not draw the bottom strips for
     // the tab indicators.
     if (tabSpec.mIndicatorStrategy is android.widget.TabHost.ViewIndicatorStrategy)
     {
         mTabWidget.setStripEnabled(false);
     }
     mTabWidget.addView(tabIndicator);
     mTabSpecs.add(tabSpec);
     if (mCurrentTab == -1)
     {
         setCurrentTab(0);
     }
 }