当前位置: 首页>>代码示例>>C#>>正文


C# ImageView.SetAdjustViewBounds方法代码示例

本文整理汇总了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;
			}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:17,代码来源:Grid2.cs

示例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);
		}
开发者ID:india-rose,项目名称:xamarin-indiarose,代码行数:40,代码来源:TitleBarView.cs

示例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);
            }
开发者ID:namratasingh123,项目名称:CardboardMonkey,代码行数:15,代码来源:CardboardOverlayView.cs

示例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;
		}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:13,代码来源:List08.cs


注:本文中的ImageView.SetAdjustViewBounds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。