forked from verybadcat/CSharpMath
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIosMathViewController.cs
More file actions
21 lines (20 loc) · 841 Bytes
/
Copy pathIosMathViewController.cs
File metadata and controls
21 lines (20 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using UIKit;
namespace CSharpMath.Ios.Example {
public class IosMathViewController : UIViewController {
public override void ViewDidLoad() {
var scrollView = new UIScrollView { BackgroundColor = UIColor.White, ScrollEnabled = true };
System.nfloat y = 0, w = 0;
foreach (var latex in Rendering.Tests.TestRenderingMathData.AllConstants.Values) {
var latexView = IosMathLabels.MathView(latex, 50); // WJWJWJ latex here
var size = latexView.SizeThatFits(new CoreGraphics.CGSize(370, 280));
latexView.Frame = new CoreGraphics.CGRect(0, y, size.Width, size.Height);
scrollView.Add(latexView);
y += size.Height;
w = size.Width > w ? size.Width : w;
y += 10;
}
scrollView.ContentSize = new CoreGraphics.CGSize(w, y);
View = scrollView;
}
}
}