本文整理汇总了C#中UILabel.WithSameHeight方法的典型用法代码示例。如果您正苦于以下问题:C# UILabel.WithSameHeight方法的具体用法?C# UILabel.WithSameHeight怎么用?C# UILabel.WithSameHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UILabel
的用法示例。
在下文中一共展示了UILabel.WithSameHeight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UICustomProgressView
public UICustomProgressView()
{
currentProgressLabel = new UILabel();
currentProgressLabel.Text = "10000000";
ofProgressLabel = new UILabel();
ofProgressLabel.Text = "of";
totalProgressLabel = new UILabel();
totalProgressLabel.Text = "10000000";
progressNoContainer = new UIView();
progressNoContainer.BackgroundColor = UIColor.Yellow;
progressNoContainer.Layer.BorderColor = UIColor.Red.CGColor;
progressNoContainer.Layer.BorderWidth = 2f;
progressNoContainer.AddSubviews(new UIView[] { currentProgressLabel, ofProgressLabel, totalProgressLabel });
progressNoContainer.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();
progressNoContainer.AddConstraints(new[]
{
currentProgressLabel.AtTopOf(progressNoContainer),
currentProgressLabel.WithSameCenterX(progressNoContainer).Minus(25),
currentProgressLabel.Height().EqualTo(30),
ofProgressLabel.WithSameTop(currentProgressLabel),
ofProgressLabel.ToRightOf(currentProgressLabel).Plus(5),
ofProgressLabel.WithSameHeight(currentProgressLabel),
totalProgressLabel.WithSameBottom(ofProgressLabel),
totalProgressLabel.ToRightOf(ofProgressLabel).Plus(5),
totalProgressLabel.WithSameHeight(ofProgressLabel)
});
AddSubviews(new[] { progressNoContainer });
this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();
this.AddConstraints(new[]
{
progressNoContainer.WithSameCenterY(this),
progressNoContainer.WithSameRight(this).Minus(10),
progressNoContainer.Width().EqualTo(100),
progressNoContainer.Height().EqualTo(30)
});
}
示例2: SetupCell
private void SetupCell(){
BackgroundColor = MobileCore.Values.Colors.BrownGray.ToNative ();
Header = new UILabel{
Frame = new RectangleF(0, 0, UIScreen.MainScreen.Bounds.Width, Constants.Layout.MinimumTouchControlSize),
TextColor = MobileCore.Values.Colors.White.ToNative(),
Lines = 0,
TextAlignment = UITextAlignment.Left
};
Add (Header);
this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints ();
this.AddConstraints (
Header.AtLeftOf(this, Constants.Layout.HorizontalPadding),
Header.AtRightOf(this),
Header.WithSameHeight(this)
);
}
示例3: LoadView
public override void LoadView ()
{
base.LoadView ();
isUserLogged = UserDefaults.BoolForKey (IsUserLoggedKey);
isAppActive = UserDefaults.BoolForKey (AppActiveEntryKey);
isAppOnBackground = UserDefaults.BoolForKey (AppBackgroundEntryKey);
marginTop = (isUserLogged && isAppActive) ? 10f : 1f;
height = (isUserLogged && isAppActive) ? 250f : 62f; // 4 x 60f(cells),
var v = new UIView {
BackgroundColor = UIColor.Clear,
Frame = new CGRect (0,0, UIScreen.MainScreen.Bounds.Width, height),
};
v.Add (tableView = new UITableView {
TranslatesAutoresizingMaskIntoConstraints = false,
BackgroundColor = UIColor.Clear,
TableFooterView = new UIView(),
ScrollEnabled = false,
RowHeight = cellHeight,
});
v.Add (openAppView = new UIView {
TranslatesAutoresizingMaskIntoConstraints = false,
Hidden = true,
});
UIView bg;
openAppView.Add (bg = new UIView {
TranslatesAutoresizingMaskIntoConstraints = false,
BackgroundColor = UIColor.Black,
Alpha = 0.1f,
});
UILabel textView;
openAppView.Add (textView = new UILabel {
TranslatesAutoresizingMaskIntoConstraints = false,
Font = UIFont.FromName ("Helvetica", 13f),
Text = isAppActive ? "NoLoggedUser".Tr() : "NoActiveApp".Tr(),
TextColor = UIColor.White,
BackgroundColor = UIColor.Clear,
});
openAppView.Add (openAppBtn = new StartStopBtn {
TranslatesAutoresizingMaskIntoConstraints = false,
IsActive = true,
});
openAppView.AddConstraints (
bg.AtTopOf (openAppView),
bg.AtLeftOf (openAppView),
bg.AtRightOf (openAppView),
bg.AtBottomOf (openAppView),
textView.WithSameCenterY (openAppView),
textView.AtLeftOf (openAppView, 50f),
textView.WithSameHeight (openAppView),
textView.AtRightOf (openAppView),
openAppBtn.Width().EqualTo (35f),
openAppBtn.Height().EqualTo (35f),
openAppBtn.AtRightOf (openAppView, 15f),
openAppBtn.WithSameCenterY (openAppView),
null
);
v.AddConstraints (
tableView.AtTopOf (v),
tableView.WithSameWidth (v),
tableView.Height().EqualTo (height - marginTop).SetPriority (UILayoutPriority.DefaultLow),
tableView.AtBottomOf (v),
openAppView.AtTopOf (v),
openAppView.WithSameWidth (v),
openAppView.Height().EqualTo (cellHeight),
null
);
View = v;
}