Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

FluentLayout for Xamarin.iOS - sample uses MvvmCross

License

NotificationsYou must be signed in to change notification settings

programmation/Cirrious.FluentLayout

 
 

Repository files navigation

FluentLayout provides an easy, fluent API for creating constraint-based layouts in Xamarin.iOS.

Build Status

How To Use

The best way to see FluentLayout in action is to check out theQuickLayout.Touch sample project, which contains many examples of creating a variety of layouts.

Basic Usage

The basic syntax of FluentLayout looks something like this:

View.AddConstraints(  fNameLabel.AtTopOf(View, vMargin),  fNameLabel.AtLeftOf(View, hMargin),  fNameLabel.ToLeftOf(sNameLabel, hMargin),  sNameLabel.WithSameTop(fNameLabel),  sNameLabel.AtRightOf(View, hMargin),  sNameLabel.WithSameWidth(fNameLabel),  fNameField.WithSameWidth(fNameLabel),  fNameField.WithSameLeft(fNameLabel),  fNameField.Below(fNameLabel, vMargin),  sNameField.WithSameLeft(sNameLabel),  sNameField.WithSameWidth(sNameLabel),  sNameField.WithSameTop(fNameField));

Advanced Usage

FluentLayout also offers some advanced layout helpers as well, such as the ability to easily lay out views as a vertical stack:

View.AddConstraints(  View.VerticalStackPanelConstraints(    new Margins(20, 10, 20, 10, 5, 5),                                                  View.Subviews));

When using theVerticalStackPanelConstraints helper each constraint added will be assigned a predictable identifier, allowing you to find relevant constraints later on if you need to. These identifiers are in the form of{containerId}-{viewId}-{constraintDescription}:

  • containerId will be the container'sAccessibilityIdentifier if one is set, andVerticalStackPanel if not
  • viewId will be the subview'sAccessibilityIdentifier if one is set, and the subview's index in the array if not
  • constraintDescription will be based on the constraint itself, such asBottom,Top,Width, etc.

About

FluentLayout for Xamarin.iOS - sample uses MvvmCross

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C#97.9%
  • F#1.5%
  • Shell0.6%

[8]ページ先頭

©2009-2025 Movatter.jp