-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix build, correctly size UIScrollViews
Summary: Closes #626 Reviewed By: emilsjolander Differential Revision: D5824425 Pulled By: splhack fbshipit-source-id: e1a8dda5e86e2705afa7f6630a6757491a94c6d6
- Loading branch information
1 parent
bcc36cc
commit 7217471
Showing
5 changed files
with
86 additions
and
23 deletions.
There are no files selected for viewing
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
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
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
51 changes: 51 additions & 0 deletions
51
csharp/iOS/Facebook.YogaKit.iOS.Tests/YogaKitNativeTest.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
|
||
} | ||
} |
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