Giter VIP home page Giter VIP logo

xamarin-uiview-positioning's Introduction

Xamarin-UIView-Positioning

UIView extensions for Xamarin + Mono projects

Based on UIView+Positioning

Usage

var x = new UIView (new RectangleF (0, 0, 100, 100));
View.AddSubview (x);

x.X(10); // Moves left 10 px
Console.WriteLine(x.X().ToString());
// 10

x.Y(10); // Moves down 10 px
Console.WriteLine(x.Y().ToString());
// 10

x.Width(10); // Sets width = 10 px
Console.WriteLine(x.Width().ToString());
// 10

x.Height(10); // Sets height = 10 px
Console.WriteLine(x.Height().ToString());
// 10

x.Origin(new PointF(10, 15)); // moves to x = 10, y = 15
Console.WriteLine(x.Origin().ToString());
// PointF 10, 15

x.Size(new SizeF(10, 15)); // Sets width = 10, height = 15
Console.WriteLine(x.Size().ToString());
// PointF 10, 15

x.Right(10); // Sets right bound to 10 px
Console.WriteLine(x.Right().ToString());
// 10

x.Bottom(10); // Sets bottom bound to 10 px
Console.WriteLine(x.Bottom().ToString());
// 10

x.CenterX(10); // Sets the center x cord to 10 px
Console.WriteLine(x.CenterX().ToString());
// 10

x.CenterY(10); // Sets the center y cord to 10 px
Console.WriteLine(x.CenterY().ToString());
// 10

Console.WriteLine(x.LastSubviewOnY().ToString());
// Outputs the bottommost subview

Console.WriteLine(x.LastSubviewOnX().ToString());
// Outputs the rightmost subview

x.CenterToParent();
// Centers a view horizontally and vertically to its parent. Must be added to a view before this is called.

xamarin-uiview-positioning's People

Contributors

camray avatar neilkennedy avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.