本文整理汇总了C#中ImageView.SetAdjustViewBounds方法的典型用法代码示例。如果您正苦于以下问题:C# ImageView.SetAdjustViewBounds方法的具体用法?C# ImageView.SetAdjustViewBounds怎么用?C# ImageView.SetAdjustViewBounds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageView
的用法示例。
在下文中一共展示了ImageView.SetAdjustViewBounds方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetView
public override View GetView (int position, View convertView, ViewGroup parent)
{
ImageView imageView;
if (convertView == null) {
imageView = new ImageView (self);
imageView.LayoutParameters = new GridView.LayoutParams (45, 45);
imageView.SetAdjustViewBounds (false);
imageView.SetScaleType (ImageView.ScaleType.CenterCrop);
imageView.SetPadding (8, 8, 8, 8);
} else {
imageView = (ImageView) convertView;
}
imageView.SetImageResource (mThumbIds[position]);
return imageView;
}
示例2: 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);
}
示例3: CardboardOverlayEyeView
public CardboardOverlayEyeView(Context context)
: base(context)
{
imageView = new ImageView(context);
imageView.SetScaleType (ImageView.ScaleType.CenterInside);
imageView.SetAdjustViewBounds (true); // Preserve aspect ratio.
AddView(imageView);
textView = new TextView(context);
textView.SetTextSize (ComplexUnitType.Dip, 14f);
textView.SetTypeface (textView.Typeface, TypefaceStyle.Bold);
textView.Gravity = GravityFlags.Center;
textView.SetShadowLayer(3.0f, 0.0f, 0.0f, Color.DarkGray);
AddView(textView);
}
示例4: GetView
public override View GetView (int position, View convertView, ViewGroup parent)
{
// Make an ImageView to show a photo
ImageView i = new ImageView (self);
i.SetImageResource (mPhotos[position]);
i.SetAdjustViewBounds (true);
i.LayoutParameters = new AbsListView.LayoutParams (AbsListView.LayoutParams.WrapContent,
AbsListView.LayoutParams.WrapContent);
// Give it a nice background
i.SetBackgroundResource (Resource.Drawable.picture_frame);
return i;
}