本文整理汇总了C#中ImageView.Measure方法的典型用法代码示例。如果您正苦于以下问题:C# ImageView.Measure方法的具体用法?C# ImageView.Measure怎么用?C# ImageView.Measure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageView
的用法示例。
在下文中一共展示了ImageView.Measure方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
private void Initialize()
{
ImageView logo = new ImageView(Context) { Id = 0x0fffff2a };
logo.SetImageResource(Resource.Drawable.logo);
logo.SetAdjustViewBounds(true);
logo.SetMinimumHeight(60);
logo.SetMaxHeight(60);
_imageCategoryView = new ImageView(Context);
_imageCategoryView.SetAdjustViewBounds(true);
_imageCategoryView.SetMinimumHeight(60);
_imageCategoryView.SetMaxHeight(60);
_imageCategoryView.Id = 0x0fffff2b;
_imageCategoryView.SetMinimumWidth(60);
_imageCategoryView.SetMaxWidth(60);
_imageCategoryView.Measure(60, 60);
_textCategoryView = new TextView(Context);
_textCategoryView.SetMaxHeight(60);
_textCategoryView.SetTextColor(Color.Black);
_textCategoryView.Id = 0x0fffff2c;
_textCategoryView.SetTextSize(ComplexUnitType.Sp, 15);
_textCategoryView.Gravity = GravityFlags.CenterVertical;
LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
lp.AddRule(LayoutRules.AlignParentRight);
lp.AddRule(LayoutRules.CenterVertical);
AddView(logo, lp);
lp = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
lp.AddRule(LayoutRules.AlignParentLeft);
lp.AddRule(LayoutRules.CenterVertical);
AddView(_imageCategoryView, lp);
lp = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
lp.AddRule(LayoutRules.RightOf, _imageCategoryView.Id);
lp.AddRule(LayoutRules.CenterVertical);
lp.SetMargins(60, 0, 60, 0);
AddView(_textCategoryView, lp);
}