-
-
Save kirtisagar/ade2a207d759f4ab800c to your computer and use it in GitHub Desktop.
fixed the tabbed page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Xamarin.Forms; | |
namespace TabPageTestCase | |
{ | |
public class App | |
{ | |
public static Page GetMainPage () | |
{ | |
return new TabbedDemoPage (); | |
} | |
} | |
public class TabbedDemoPage : TabbedPage | |
{ | |
public TabbedDemoPage () | |
{ | |
Title = "TabbedPage"; | |
//this.ItemsSource = new NamedColor[] { | |
// new NamedColor ("Red"), | |
// new NamedColor ("Yellow"), | |
// new NamedColor ("Green"), | |
// new NamedColor ("Aqua"), | |
// new NamedColor ("Blue"), | |
// new NamedColor ("Purple"), | |
// new NamedColor ("Olive") | |
//}; | |
//ItemTemplate = new DataTemplate (() => new TabPage ()); | |
var myPages = new NamedColor[] | |
{ | |
new NamedColor("Red"), | |
new NamedColor("Yellow"), | |
new NamedColor("Green"), | |
new NamedColor("Aqua"), | |
new NamedColor("Blue"), | |
new NamedColor("Purple"), | |
new NamedColor("Olive") | |
}; | |
foreach (var item in myPages) | |
{ | |
this.Children.Add(new TabPage() { BindingContext = item }); | |
} | |
} | |
} | |
public class NamedColor | |
{ | |
public string Name { | |
get; | |
set; | |
} | |
public NamedColor (string name) | |
{ | |
Name = name; | |
} | |
} | |
public class TabPage : ContentPage | |
{ | |
readonly Label myLabel; | |
public TabPage () | |
{ | |
myLabel = new Label { | |
VerticalOptions = LayoutOptions.CenterAndExpand, | |
HorizontalOptions = LayoutOptions.CenterAndExpand, | |
}; | |
myLabel.SetBinding (Label.TextProperty, "Name"); | |
this.SetBinding (Page.TitleProperty, "Name"); | |
Content = myLabel; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fixed the tabbed page more button issue in iOS