本文整理汇总了C#中LinearLayout.Measure方法的典型用法代码示例。如果您正苦于以下问题:C# LinearLayout.Measure方法的具体用法?C# LinearLayout.Measure怎么用?C# LinearLayout.Measure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinearLayout
的用法示例。
在下文中一共展示了LinearLayout.Measure方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PackageRow
public PackageRow(Context context)
: base(context)
{
SetBackgroundColor(Color.Rgb(240, 240, 240));
Orientation = Orientation.Horizontal;
textContainer = new LinearLayout(context);
textContainer.Orientation = Orientation.Vertical;
AddView(textContainer);
buttonContainer = new LinearLayout(context);
AddView(buttonContainer);
int height = context.Resources.DisplayMetrics.HeightPixels / 10;
LayoutParameters = new AbsListView.LayoutParams(LayoutParams.MatchParent, height);
textContainer.LayoutParameters = new LinearLayout.LayoutParams(0, LayoutParams.MatchParent, 7);
buttonContainer.LayoutParameters = new LinearLayout.LayoutParams(0, LayoutParams.MatchParent, 3);
nameLabel = new TextView(context);
nameLabel.SetTextColor(Color.Black);
nameLabel.Gravity = Android.Views.GravityFlags.CenterVertical;
nameLabel.Typeface = Typeface.Create("Helvetica Neue", TypefaceStyle.Normal);
nameLabel.SetTextSize(Android.Util.ComplexUnitType.Dip, 16);
textContainer.AddView(nameLabel);
statusLabel = new TextView(context);
statusLabel.SetTextColor(Color.DarkGray);
statusLabel.Gravity = Android.Views.GravityFlags.Top;
statusLabel.Typeface = Typeface.Create("Helvetica Neue", TypefaceStyle.Normal);
textContainer.AddView(statusLabel);
Button = new PMButton(context);
buttonContainer.AddView(Button);
buttonContainer.Measure(0, 0);
padding = buttonContainer.MeasuredHeight / 3;
Button.LayoutParameters = GetButtonParams(padding);
}