本文整理汇总了C#中Xamarin.Forms.ScrollView类的典型用法代码示例。如果您正苦于以下问题:C# ScrollView类的具体用法?C# ScrollView怎么用?C# ScrollView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ScrollView类属于Xamarin.Forms命名空间,在下文中一共展示了ScrollView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ValidateNumberPage
public ValidateNumberPage()
{
cursorLabel = new LabelCustomFont {
Text = ">"
};
entryNumber = new EntryCustomFont {
HorizontalOptions = LayoutOptions.FillAndExpand,
Keyboard = Keyboard.Numeric
};
entryNumber.Completed += OnNumberEntryCompleted;
stackLayout = new StackLayout {
Padding = new Thickness(16),
Children = {
new LabelCustomFont {
Text = "ENTER A CREDIT CARD NUMBER:"
},
new StackLayout {
Children = {
cursorLabel, entryNumber
},
Orientation = StackOrientation.Horizontal,
Spacing = 0
}
}
};
Content = new ScrollView() {
Content = stackLayout,
HorizontalOptions = LayoutOptions.FillAndExpand,
Orientation = ScrollOrientation.Vertical
};
}
开发者ID:jonathanzuniga,项目名称:ValidateCreditCardNumber,代码行数:33,代码来源:ValidateNumberPage.cs
示例2: ProjectsPage
public ProjectsPage()
{
ProjectsViewModel projectsVM = new ProjectsViewModel();
var layout = new StackLayout
{
Spacing = 0,
VerticalOptions = LayoutOptions.FillAndExpand
};
foreach (Project project in projectsVM.Projects)
{
layout.Children.Add(new Label
{
Text = project.title
});
layout.Children.Add(new Label
{
Text = project.description
});
layout.Children.Add(new Label
{
Text = $"Type: {project.type}"
});
}
Content = new ScrollView
{
Content = layout
};
}
开发者ID:JoshiAbhishek,项目名称:XamarinPersonalPortfolio,代码行数:33,代码来源:ProjectsPage.cs
示例3: MainPage
public MainPage()
{
Label theLabel = new Label() {
Text = " click ",
HorizontalOptions = LayoutOptions.CenterAndExpand,
VerticalOptions = LayoutOptions.CenterAndExpand
};
Button theButton = new Button() {
Text = "Click Me",
HorizontalOptions = LayoutOptions.CenterAndExpand,
VerticalOptions = LayoutOptions.CenterAndExpand
};
theButton.Clicked +=(sender, e) => {
theLabel.Text = string.Format("{0} {1}"," click ",theLabel.Text);
};
DatePicker dtPicket = new DatePicker();
var container = new StackLayout() {
Padding = new Thickness(20, Device.OnPlatform(20,0,0),20,20)
};
container.Children.Add(dtPicket);
container.Children.Add(theButton);
container.Children.Add(theLabel);
Content = new ScrollView() { Content = container };
}
开发者ID:klimaye,项目名称:XamarinFormPlay,代码行数:28,代码来源:App.cs
示例4: AbsoluteLayoutPageCode
public AbsoluteLayoutPageCode ()
{
Title = "AbsoluteLayout - C#";
BackgroundImage = "deer.jpg";
var outerLayout = new AbsoluteLayout ();
var scroll = new ScrollView ();
outerLayout.Children.Add (scroll, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
outerLayout.Children.Add (new Button {
Text = "Previous",
BackgroundColor = Color.White,
TextColor = Color.Green,
BorderRadius = 0
}, new Rectangle (0, 1, .5, 60), AbsoluteLayoutFlags.PositionProportional | AbsoluteLayoutFlags.WidthProportional);
outerLayout.Children.Add (new Button {
Text = "Next",
BackgroundColor = Color.White,
TextColor = Color.Green,
BorderRadius = 0
}, new Rectangle (1, 1, .5, 60), AbsoluteLayoutFlags.PositionProportional | AbsoluteLayoutFlags.WidthProportional);
var innerLayout = new AbsoluteLayout ();
scroll.Content = innerLayout;
innerLayout.Children.Add (new Image { Source = "deer.jpg" }, new Rectangle (.5, 0, 300, 300), AbsoluteLayoutFlags.PositionProportional);
innerLayout.Children.Add (new BoxView { Color = Color.FromHex ("#CC1A7019") }, new Rectangle (.5, 300, .7, 50), AbsoluteLayoutFlags.XProportional | AbsoluteLayoutFlags.WidthProportional);
innerLayout.Children.Add (new Label { Text = "deer.jpg", XAlign = TextAlignment.Center, TextColor = Color.White }, new Rectangle (.5, 310, 1, 50), AbsoluteLayoutFlags.XProportional | AbsoluteLayoutFlags.WidthProportional);
Content = outerLayout;
}
开发者ID:zhenningshao,项目名称:xamarin-forms-samples,代码行数:26,代码来源:AbsoluteLayoutPageCode.cs
示例5: SlideShowView
public SlideShowView ()
{
HeightRequest = 200;
var image1 = new Image() {Source = new FileImageSource(){ File = "bama1.jpg"}};
var image2 = new Image() {Source = new FileImageSource(){ File = "bama2.jpg"}};
var image3 = new Image() {Source = new FileImageSource(){ File = "bama3.jpg"}};
var image4 = new Image() {Source = new FileImageSource(){ File = "bama4.jpg"}};
var image5 = new Image() {Source = new FileImageSource(){ File = "bama5.jpg"}};
var image6 = new Image() {Source = new FileImageSource(){ File = "bama6.jpg"}};
var image7 = new Image() {Source = new FileImageSource(){ File = "bama7.jpg"}};
var image8 = new Image() {Source = new FileImageSource(){ File = "bama8.jpg"}};
var image9 = new Image() {Source = new FileImageSource(){ File = "bama9.jpg"}};
var stack = new StackLayout () {
Padding = new Thickness(0,0,0,10),
Orientation = StackOrientation.Horizontal,
Spacing = 10,
Children = {
image1,
image2,
image3,
image4,
image5,
image6,
image7,
image8,
image9
}
};
Content = new ScrollView() {
Content = stack,
Orientation = ScrollOrientation.Horizontal};
}
开发者ID:Sway0308,项目名称:Xamarin-Forms-InAnger,代码行数:35,代码来源:SlideShowView.cs
示例6: MovieDetail
public MovieDetail(string title, string rate, string poster, string descritption)
{
Title =title;
Label rating = new Label {
Text = rate,
FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
HorizontalOptions = LayoutOptions.Center
};
Image image = new Image{
Source=poster,
HeightRequest = 350,
WidthRequest = 125
};
Label description = new Label {
Text = descritption,
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
HorizontalOptions = LayoutOptions.CenterAndExpand,
};
StackLayout stackLayout = new StackLayout {
Children = {rating, image, description}
};
ScrollView scroll = new ScrollView{
Content = stackLayout
};
this.Content = scroll;
}
开发者ID:jamesqquick,项目名称:XamarinForms,代码行数:31,代码来源:MovieDetail.cs
示例7: CoursePageDB
public CoursePageDB()
{
Padding = new Thickness(10, Device.OnPlatform(20,0,0),10,0);
BackgroundColor = Color.Gray;
//this.Title = course.TitleShort;
this.SetBinding(ContentPage.TitleProperty, "TitleShort");
var titleLabel = new Label() {/*Text = course.Title,*/ Font = Font.SystemFontOfSize(NamedSize.Large)};
titleLabel.SetBinding(Label.TextProperty,"Title");
var authorLabel = new Label() {/*Text = course.Author,*/ Font = Font.SystemFontOfSize(NamedSize.Small)};
authorLabel.SetBinding(Label.TextProperty,"Author");
var descriptionLabel = new Label() {/*Text = course.Description,*/ Font = Font.SystemFontOfSize(NamedSize.Medium)};
descriptionLabel.SetBinding(Label.TextProperty, "Description");
Content = new ScrollView()
{
Content = new StackLayout()
{
Spacing = 10,
Children = { titleLabel,authorLabel,descriptionLabel}
}
};
}
开发者ID:mkonkolowicz,项目名称:KnockKnock,代码行数:27,代码来源:CoursePageDB.cs
示例8: HomePage
public HomePage(string username)
: base("HomePage")
{
_mainScroll = new ScrollView {
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand
};
this.Content = _mainScroll;
_mainStack = new StackLayout{
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand
};
_mainScroll.Content = _mainStack;
_homepageTitle = new Label {
Text = "Welcome, " + username + "!",
HorizontalOptions = LayoutOptions.CenterAndExpand
};
_mainStack.Children.Add (_homepageTitle);
_next = new Views.TrackingButton(this.Title) {
Text = "Next",
HorizontalOptions = LayoutOptions.CenterAndExpand
};
_next.Clicked += Next_Clicked;
_mainStack.Children.Add (_next);
}
开发者ID:TheEightBot,项目名称:Xamalytics,代码行数:30,代码来源:Homepage.cs
示例9: CallPutPage
public CallPutPage ()
{
BackgroundColor = MyColors.MidnightBlue;
var stackLayout = new StackLayout {
Padding = new Thickness (15),
Children = {
new Label {
Text = "Compare call/put price against $100",
HorizontalOptions = LayoutOptions.CenterAndExpand,
FontAttributes = FontAttributes.Bold,
TextColor = MyColors.Clouds
},
new BoxView{ HeightRequest = 10, Opacity = 0 },
callValueEntry,
new BoxView{ HeightRequest = 10, Opacity = 0 },
putValueEntry,
new BoxView{ HeightRequest = 10, Opacity = 0 },
calcuatePayoffButton,
}
};
var scrollView = new ScrollView ();
scrollView.Content = stackLayout;
Content = scrollView;
calcuatePayoffButton.Clicked += CalcuatePayoffButton_Clicked;
}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:29,代码来源:CallPutPage.cs
示例10: LoginPage
public LoginPage()
{
BindingContext = new LoginViewModel(Navigation);
var layout = new StackLayout { Padding = 10 };
var label = new Label
{
Text = "Login",
FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
TextColor = Color.White,
VerticalOptions = LayoutOptions.Start,
HorizontalTextAlignment = TextAlignment.Center,
VerticalTextAlignment = TextAlignment.Center,
};
layout.Children.Add(label);
var username = new Entry { Placeholder = "Username" };
username.SetBinding(Entry.TextProperty, LoginViewModel.UsernamePropertyName);
layout.Children.Add(username);
var password = new Entry { Placeholder = "Password", IsPassword = true };
password.SetBinding(Entry.TextProperty, LoginViewModel.PasswordPropertyName);
layout.Children.Add(password);
var button = new Button { Text = "Sign In", TextColor = Color.White };
button.SetBinding(Button.CommandProperty, LoginViewModel.LoginCommandPropertyName);
layout.Children.Add(button);
Content = new ScrollView { Content = layout };
}
开发者ID:Zepsen,项目名称:App1,代码行数:33,代码来源:LoginPage.cs
示例11: ConfigSpringboard
public ConfigSpringboard()
{
NavigationPage.SetHasNavigationBar (this, false);
Grid configGrid = new Grid {
BackgroundColor = Colours.BG_DARK,
Padding = new Thickness(10),
RowDefinitions = {
new RowDefinition {
Height = new GridLength(150, GridUnitType.Absolute)
}
},
ColumnDefinitions = {
new ColumnDefinition {
Width = new GridLength(1, GridUnitType.Star)
},
new ColumnDefinition {
Width = new GridLength(1, GridUnitType.Star)
}
}
};
HomeButton UC = new HomeButton (IconLabel.Icon.FAUser, "YOUR INFO", Colours.USERCONFIG_LIGHT, Colours.USERCONFIG_MEDIUM);
HomeButton AC = new HomeButton (IconLabel.Icon.FABell, "ALERTS CONFIG", Colours.ALERTSCONFIG_LIGHT, Colours.ALERTSCONFIG_MEDIUM);
var alertConfigTapGestureRecognizer = new TapGestureRecognizer ();
alertConfigTapGestureRecognizer.Tapped += async (s, e) => {
if (AC.IsEnabled) {
AC.IsEnabled = false;
await AC.ScaleTo(.8, 100);
await AC.ScaleTo(1, 100);
await Navigation.PushAsync (await AlertConfigContainer.CreateAlertConfigContainer());
AC.IsEnabled = true;
}
};
AC.GestureRecognizers.Add (alertConfigTapGestureRecognizer);
var userConfigTapGestureRecognizer = new TapGestureRecognizer ();
userConfigTapGestureRecognizer.Tapped += async (s, e) => {
if (UC.IsEnabled) {
UC.IsEnabled = false;
await UC.ScaleTo(.8, 100);
await UC.ScaleTo(1, 100);
await Navigation.PushAsync (await YourInfoPageContainer.CreateYourInfoPageContainer());
UC.IsEnabled = true;
}
};
UC.GestureRecognizers.Add (userConfigTapGestureRecognizer);
configGrid.Children.Add (UC, 0, 0);
configGrid.Children.Add (AC, 1, 0);
ScrollView scrollView = new ScrollView {
Orientation = ScrollOrientation.Vertical,
Content = configGrid,
VerticalOptions = LayoutOptions.FillAndExpand
};
Content = scrollView;
}
开发者ID:DaveCaldeira,项目名称:NavigationTest,代码行数:60,代码来源:ConfigSpringboard.cs
示例12: AddTaxaPage
//private bool _taxaTxtChanged;
public AddTaxaPage(string title) {
var scrollView = new ScrollView();
var contentStack = new StackLayout {
VerticalOptions = LayoutOptions.Start,
HorizontalOptions = LayoutOptions.Start
};
_taxaStack = new StackLayout {
Orientation = StackOrientation.Vertical,
HorizontalOptions = LayoutOptions.FillAndExpand
};
var numLabel = new Label { Text = "Enter Number of Taxa:" };
_numEntry = new Entry { WidthRequest = 50 };
_numEntry.Completed += NumTaxa_OnCompleted;
_numEntry.Keyboard = Keyboard.Numeric;
_numEntry.BindingContext = new EntryRestrictions();
_numEntry.SetBinding(Entry.TextProperty, "Num1To99");
contentStack.Children.Add(numLabel);
contentStack.Children.Add(_numEntry);
_noteLabel = new Label { Text = "These are the organisms you will be comparing." };
contentStack.Children.Add(_noteLabel);
contentStack.Children.Add(_taxaStack);
_addTaxaBtn.Clicked += OnAddTaxa;
_addTaxaBtn.BackgroundColor = Color.Accent;
_addTaxaBtn.IsEnabled = false;
_addTaxaBtn.IsVisible = false;
contentStack.Children.Add(_addTaxaBtn);
scrollView.Content = contentStack;
Content = scrollView;
Title = title;
}
开发者ID:kflo,项目名称:phylo,代码行数:34,代码来源:AddTaxaPage.xaml.cs
示例13: CameraView
public CameraView ()
{
done = false;
this.layout = new StackLayout{ Padding = 10 };
btn = new Button ();
btn1 = new Button ();
btn2 = new Button ();
btn.Text = "Take picture";
btn1.Text = " Select Picture";
btn2.Text = "Add ticket";
imgByte = null;
_imageSource = new Image ();
_imageSource.Aspect = Aspect.AspectFill;
layout.Children.Add (btn);
layout.Children.Add (btn1);
layout.Children.Add (_imageSource);
btn.Clicked+= Btn_Clicked;
btn1.Clicked+= Btn1_Clicked;
btn2.Clicked+= Btn2_Clicked;
Content = new ScrollView { Content = layout };
}
开发者ID:joaodealmeida,项目名称:EuromillionsDraws,代码行数:29,代码来源:CameraView.cs
示例14: GameDetailPage
public GameDetailPage()
{
Content = new ScrollView () {
Content = new StackLayout () {
Padding = new Thickness(0,0,0,30),
Orientation = StackOrientation.Vertical,
VerticalOptions = LayoutOptions.Start,
Children = {
Picture (),
Space(),
GameName(),
HorzLine (),
GamePrice (),
HorzLine (),
GameCount (),
Space2 (),
GameMenu (),TotalGamePicker (),
AddtoCartButton ()
}
}
};
}
开发者ID:camotts,项目名称:383-Admin-Portal-Mobile-App,代码行数:26,代码来源:GameDetailPage.cs
示例15: RenderContent
private void RenderContent()
{
ScrollView scrollview = new ScrollView() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand};
var rootLayout = new StackLayout() { BackgroundColor = Color.Black, Spacing = 15, Orientation = StackOrientation.Vertical, HorizontalOptions = LayoutOptions.FillAndExpand, Padding = new Thickness(0, 0, 0, 10) }; // Padding = new Thickness(45, 15, 45, 15),
ContentView header = new ContentView() { BackgroundColor = Color.Black, HorizontalOptions = LayoutOptions.FillAndExpand, Padding = new Thickness(0, 80, 0, 0) };
rootLayout.Children.Add(header);
btnGoogleLogIn = new Button() {
Text = " LOG IN WITH GOOGLE ",
FontAttributes = FontAttributes.Bold,
BackgroundColor = Color.Green,
TextColor = Color.White,
HorizontalOptions = LayoutOptions.Center
};
rootLayout.Children.Add(btnGoogleLogIn);
scrollview.Content = rootLayout;
if (Device.OS == TargetPlatform.Android)
{
scrollview.IsClippedToBounds = true;
}
Content = scrollview;
}
开发者ID:Jake-a-Lake,项目名称:GaragePrincess,代码行数:26,代码来源:StartPage.cs
示例16: SoldCars
public SoldCars()
{
InitializeComponent();
manager = CarItemManager.DefaultManager;
var instructionStack = new StackLayout () { BackgroundColor = Color.FromHex(ThemeColors.PrimaryDark), Padding=new Thickness (15, 15, 15, 15)};
var instructionLabel = new Label () {
Text = "Click on an Entry for Details",
FontSize = Device.GetNamedSize (NamedSize.Large, typeof(Label)),
TextColor=Color.FromHex(ThemeColors.TextIcons)
};
instructionStack.Children.Add (instructionLabel);
var scrollview = new ScrollView
{
Content = new StackLayout
{
Children = { instructionStack, todoList },
},
};
var outerStack = new StackLayout(); outerStack.Children.Add(scrollview);
Content = outerStack;
}
开发者ID:Sanjisan,项目名称:SoftwareEngineering-SUSF2016,代码行数:27,代码来源:SoldCars.xaml.cs
示例17: StartPage
public StartPage()
{
Title = "DataSave Sample";
Padding = 16;
Content = new ScrollView
{
Content = new StackLayout
{
Spacing = 10,
Children = {
new Button { Text = "Save to dictionay (C#)",
Command = new Command(async ()=> await Navigation.PushAsync(new SaveToDictionaryCS()))
},
new Button { Text = "Save to dic by ViewModel (C#)",
Command = new Command(async () => await Navigation.PushAsync(new SaveByVMCS()))
},
new Button { Text = "Save to dic by ViewModel (Xaml)",
Command = new Command(async () => await Navigation.PushAsync(new SaveByVMXaml()))
},
new Button { Text = "Save to json (C#)",
Command = new Command(async () => await Navigation.PushAsync(new SaveToJsonCS()))
},
new Button { Text = "Save to json (Xaml)",
Command = new Command(async () => await Navigation.PushAsync(new SaveToJsonXaml()))
},
}
}
};
}
开发者ID:zcccust,项目名称:Study,代码行数:29,代码来源:App.cs
示例18: TrackingPage
public TrackingPage()
{
Title = "Tracking";
Padding = new Thickness (20, 20, 20, 20);
locationLabel = new Label {
Text = "Location",
HorizontalOptions = LayoutOptions.CenterAndExpand,
};
directionLabel = new Label {
Text = "Direction",
HorizontalOptions = LayoutOptions.CenterAndExpand,
VerticalOptions = LayoutOptions.CenterAndExpand,
Font = Font.SystemFontOfSize(14)
};
var layout = new StackLayout {
Children = { locationLabel, directionLabel }
};
var scroll = new ScrollView () {
Content = layout
};
Content = scroll;
var timer = new Timer (1000);
timer.Elapsed += OnTimerElapsed;
timer.Start ();
}
开发者ID:rosekl,项目名称:xamarin-ibeacon-demo,代码行数:33,代码来源:TrackingPage.cs
示例19: AboutPage
public AboutPage()
{
Title = "Informacoes";
// GetValue ();
var stack = new StackLayout {
VerticalOptions = LayoutOptions.FillAndExpand,
Children = {
lbInformation
}
};
var scroll = new ScrollView {
BackgroundColor = Colors.BackgroundDefault,
Content = stack
};
var absoluteLayout = new AbsoluteLayout ();
var background = new Image {
Style = Styles.BackgroundImage
};
absoluteLayout.Children.Add (background, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
absoluteLayout.Children.Add (scroll, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
Content = absoluteLayout;
}
开发者ID:RobertoOFonseca,项目名称:MySafety,代码行数:28,代码来源:AboutPage.cs
示例20: SetupStepView
public static void SetupStepView(RelativeLayout rLayout, ScrollView helpSv, StackLayout questionContainer, Command questionTappedCmd)
{
var tgr = new TapGestureRecognizer()
{
Command = new Command((obj) =>
{
var oldBound = helpSv.Bounds;
if (oldBound.Height == 40)
{
// Need to show.
var newBound = new Rectangle(0, rLayout.Height - 200, rLayout.Width, 200);
helpSv.LayoutTo(newBound, 250, Easing.CubicInOut);
}
else
{
// Need to hide.
var newBound = new Rectangle(0, rLayout.Height - 40, rLayout.Width, 40);
helpSv.LayoutTo(newBound, 250, Easing.CubicInOut);
}
})
};
helpSv.GestureRecognizers.Add(tgr);
var qControls = questionContainer.Children.Where(x => x is QuestionLayout).Cast<QuestionLayout>();
var currIdx = 0;
foreach (var qControl in qControls)
{
var questionTgr = new TapGestureRecognizer()
{
Command = questionTappedCmd,
CommandParameter = currIdx,
};
qControl.GestureRecognizers.Add(questionTgr);
currIdx++;
}
}
开发者ID:NamXH,项目名称:Orchard,代码行数:35,代码来源:ViewUtils.cs
注:本文中的Xamarin.Forms.ScrollView类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论