fix build, correctly size UIScrollViews
Summary: Closes https://github.com/facebook/yoga/pull/626 Reviewed By: emilsjolander Differential Revision: D5824425 Pulled By: splhack fbshipit-source-id: e1a8dda5e86e2705afa7f6630a6757491a94c6d6
This commit is contained in:
committed by
Facebook Github Bot
parent
bcc36cc1b2
commit
7217471427
51
csharp/iOS/Facebook.YogaKit.iOS.Tests/YogaKitNativeTest.cs
Normal file
51
csharp/iOS/Facebook.YogaKit.iOS.Tests/YogaKitNativeTest.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System.Drawing;
|
||||
using Facebook.Yoga;
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using UIKit;
|
||||
using CoreGraphics;
|
||||
|
||||
namespace Facebook.YogaKit.iOS.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class YogaKitNativeTest
|
||||
{
|
||||
[Test]
|
||||
public void ScrollViewVertical()
|
||||
{
|
||||
var view = new UIScrollView() {
|
||||
Frame = new CGRect(0, 0, 100, 100),
|
||||
};
|
||||
|
||||
view.Yoga().Overflow = YogaOverflow.Scroll;
|
||||
var subview = new UIView();
|
||||
subview.Yoga().Height = 1000;
|
||||
subview.Yoga().IsEnabled = true;
|
||||
|
||||
view.AddSubview(subview);
|
||||
view.Yoga().IsEnabled = true;
|
||||
view.Yoga().ApplyLayout();
|
||||
Assert.True(view.ContentSize.Height == 1000);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void NormalViewVertical()
|
||||
{
|
||||
var view = new UIView() {
|
||||
Frame = new CGRect(0,0, 100, 100),
|
||||
};
|
||||
|
||||
|
||||
var subview = new UIView();
|
||||
subview.Yoga().Height = 1000;
|
||||
subview.Yoga().Width = 2;
|
||||
subview.Yoga().IsEnabled = true;
|
||||
|
||||
view.AddSubview(subview);
|
||||
view.Yoga().IsEnabled = true;
|
||||
view.Yoga().ApplyLayout();
|
||||
Assert.True(view.Bounds.Height == 100);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user