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


C# ImageButton.SetMinimumHeight方法代码示例

本文整理汇总了C#中ImageButton.SetMinimumHeight方法的典型用法代码示例。如果您正苦于以下问题:C# ImageButton.SetMinimumHeight方法的具体用法?C# ImageButton.SetMinimumHeight怎么用?C# ImageButton.SetMinimumHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageButton的用法示例。


在下文中一共展示了ImageButton.SetMinimumHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitView

		public void InitView(List<BookingDocumentDto> _bookingDocs) {
			this.RemoveAllViews ();
			int size = _bookingDocs.Count;
			for(int i = 0; i < size; i ++) {
				LinearLayout ll = new LinearLayout (_context);
				ll.Orientation = Orientation.Horizontal;
				ll.SetVerticalGravity (GravityFlags.CenterVertical);

				ImageView imgFile = new ImageView (_context);
				imgFile.SetImageResource (Resource.Drawable.ic_attach);

				var tvFileAttach = new TextView (_context) {
					Text = _bookingDocs[i].OriginalFileName
				};
				tvFileAttach.Id = i;
				tvFileAttach.SetTextColor (Color.Blue);
				tvFileAttach.PaintFlags = PaintFlags.UnderlineText;
				tvFileAttach.SetTypeface (null, TypefaceStyle.Bold);
				tvFileAttach.SetSingleLine (true);
				tvFileAttach.Ellipsize = global::Android.Text.TextUtils.TruncateAt.Middle;
				tvFileAttach.SetPadding (5, 0, 10, 0);
				LayoutParams param = new TableRow.LayoutParams(0, LayoutParams.WrapContent, 1f);
				tvFileAttach.LayoutParameters = param;
				tvFileAttach.Click += (sender, e) => {
					utilsAndroid.onViewFile(_context, _bookingDocs[tvFileAttach.Id].S3FileName);
				};

				ImageButton imgDelete = new ImageButton (_context);
				imgDelete.Id = i;
				imgDelete.SetImageResource (Resource.Drawable.ic_delete);
				imgDelete.SetMinimumWidth (50);
				imgDelete.SetMinimumHeight (50);
				imgDelete.SetBackgroundColor (Color.Transparent);
				imgDelete.Click += (sender, e) => {
					_deleteFile.onDeleteFile(_isInConference, _bookingDocs[imgDelete.Id]);
				};

				ll.AddView (imgFile);
				ll.AddView (tvFileAttach);
				ll.AddView (imgDelete);
				ll.SetPadding (0, 5, 0, 5);

				this.AddView (ll);
			}
		}
开发者ID:borain89vn,项目名称:demo2,代码行数:45,代码来源:OnAddFileToView.cs

示例2: GetPasswordAsync

 public Task<string> GetPasswordAsync(Stream keypadImageStream, IList<MapAreaInfo> mapAreas, SiteManager site)
 {
     var tcs = new TaskCompletionSource<string>();
     var adb = new AlertDialog.Builder(Context);
     using (var inflater = LayoutInflater.From(adb.Context))
     {
         var view = inflater.Inflate(Resource.Layout.XjtuCardPassword, null);
         var passwordView = view.FindViewById<TextView>(Resource.Id.passwordTextView);
         var padTable = view.FindViewById<TableLayout>(Resource.Id.passwordPadTable);
         var currentPassword = "";
         Action updatePasswordDisplay = () =>
         {
             passwordView.Text = new string('#', currentPassword.Length);
         };
         //生成按键。
         var keypadBitmap = BitmapFactory.DecodeStream(keypadImageStream);
         for (var row = 0; row < 4; row++)
         {
             var tr = new TableRow(adb.Context)
             {
                 LayoutParameters = new ViewGroup.LayoutParams(
                     ViewGroup.LayoutParams.WrapContent,
                     ViewGroup.LayoutParams.WrapContent)
             };
             padTable.AddView(tr);
             for (var col = 0; col < 3; col++)
             {
                 var index = row * 3 + col;
                 var indexExpr = Convert.ToString(index);
                 View buttonView = null;
                 if (index <= 9)
                 {
                     var area = mapAreas.First(a => a.Value == indexExpr);
                     var button = new ImageButton(adb.Context)
                     {
                         LayoutParameters = new TableRow.LayoutParams(
                             ViewGroup.LayoutParams.WrapContent,
                             ViewGroup.LayoutParams.WrapContent),
                     };
                     button.SetMinimumWidth(DroidUtility.DipToPixelsX(64));
                     button.SetMinimumHeight(DroidUtility.DipToPixelsY(64));
                     button.SetImageBitmap(Bitmap.CreateBitmap(keypadBitmap, area.X1, area.Y1, area.Width, area.Height));
                     button.SetScaleType(ImageView.ScaleType.FitCenter);
                     button.Click += (_, e) =>
                     {
                         currentPassword += indexExpr;
                         updatePasswordDisplay();
                     };
                     buttonView = button;
                 } else if (index == 10)
                 {
                     var button = new Button(adb.Context)
                     {
                         Text = "更正",
                         LayoutParameters = new TableRow.LayoutParams(
                             ViewGroup.LayoutParams.MatchParent,
                             ViewGroup.LayoutParams.WrapContent)
                         {
                             Span = 2,
                             Gravity = GravityFlags.CenterVertical
                         }
                     };
                     button.Click += (_, e) =>
                     {
                         currentPassword = "";
                         updatePasswordDisplay();
                     };
                     buttonView = button;
                 }
                 if (buttonView != null)
                 {
                     tr.AddView(buttonView);
                 }
             }
         }
         //初始化界面。
         updatePasswordDisplay();
         adb.SetView(view)
             .SetPositiveButton("确定", (_, e) =>
             {
                 tcs.SetResult(currentPassword);
             })
             .SetNegativeButton("取消", (_, e) =>
             {
                 tcs.SetResult(null);
             })
             .Show();
     }
     return tcs.Task;
 }
开发者ID:CXuesong,项目名称:App2,代码行数:90,代码来源:ManualVerificationProvider.cs


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