Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- View.BackgroundColor = UIColor.LightGray;
- Title = "Tip Calculator";
- var statusBarHeight = UIApplication.SharedApplication.StatusBarFrame.Height;
- var topPadding = UIApplication.SharedApplication.Windows[0].SafeAreaInsets.Top + statusBarHeight;
- totalAmount = new UITextField()
- {
- Frame = new CGRect(20, topPadding + 20, View.Bounds.Width - 40, 35),
- KeyboardType = UIKeyboardType.DecimalPad,
- BorderStyle = UITextBorderStyle.RoundedRect,
- Placeholder = "Enter Total Amount",
- AutoresizingMask = UIViewAutoresizing.FlexibleWidth
- };
- calcButton = new UIButton(UIButtonType.Custom)
- {
- Frame = new CGRect(20, 71 + topPadding, View.Bounds.Width - 40, 45),
- BackgroundColor = UIColor.FromRGB(0, 0.5f, 0),
- AutoresizingMask = UIViewAutoresizing.FlexibleWidth
- };
- calcButton.SetTitle("Calculate", UIControlState.Normal);
- resultLabel = new UILabel()
- {
- Frame = new CGRect(20, 124 + topPadding, View.Bounds.Width - 40, 40),
- TextColor = UIColor.Blue,
- TextAlignment = UITextAlignment.Center,
- Font = UIFont.SystemFontOfSize(24),
- Text = "Tip is $0.00",
- AutoresizingMask = UIViewAutoresizing.FlexibleWidth
- };
- navButton = new UIButton(UIButtonType.Custom)
- {
- Frame = new CGRect(20, 170 + topPadding, View.Bounds.Width - 40, 45),
- BackgroundColor = UIColor.FromRGB(0, 0.5f, 0),
- AutoresizingMask = UIViewAutoresizing.FlexibleWidth
- };
- navButton.SetTitle("Navigate", UIControlState.Normal);
- View.AddSubviews(totalAmount, calcButton, resultLabel, navButton);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement