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


C# Forms.Cell类代码示例

本文整理汇总了C#中Xamarin.Forms.Cell的典型用法代码示例。如果您正苦于以下问题:C# Cell类的具体用法?C# Cell怎么用?C# Cell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Cell类属于Xamarin.Forms命名空间,在下文中一共展示了Cell类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetCell

        public override UIKit.UITableViewCell GetCell(Cell item, UIKit.UITableViewCell reusableCell, UIKit.UITableView tv)
        {
            var cell = base.GetCell(item, reusableCell, tv);
            cell.SelectionStyle = UIKit.UITableViewCellSelectionStyle.None;

            return cell;
        }
开发者ID:rringham,项目名称:XamarinOffice365,代码行数:7,代码来源:IosNoHighlightListViewCellRenderer.cs

示例2: GetCellCore

    protected override Android.Views.View GetCellCore(Cell item, Android.Views.View convertView, Android.Views.ViewGroup parent, Context context)
		{
      var cell = (LinearLayout)base.GetCellCore(item, convertView, parent, context);
      var image = (ImageView)cell.GetChildAt(0);
      image.SetScaleType(ImageView.ScaleType.CenterCrop);
      return cell;
		}
开发者ID:XnainA,项目名称:Xamarin.Forms-Monkeys,代码行数:7,代码来源:AspectImageCellRenderer.cs

示例3: GetCell

		public override UIKit.UITableViewCell GetCell (Cell item, UIKit.UITableViewCell reusableCell, UIKit.UITableView tv)
		{
			var cell = base.GetCell (item, reusableCell, tv);
			cell.SeparatorInset = UIEdgeInsets.Zero;
			cell.TextLabel.Font = UIFont.FromName ("baskervillebecker", 18f);
			return cell;
		}
开发者ID:Vineland,项目名称:DarkestNight.App,代码行数:7,代码来源:CustomImageCellRenderer.cs

示例4: GetCell

        public override UITableViewCell GetCell (Cell item, UITableView tv)
        {
            var viewModel = (AgendaCellViewModel)item.BindingContext;
            var cellTableViewCell = tv.DequeueReusableCell ("cell") as CellTableViewCell
                ?? new CellTableViewCell (UITableViewCellStyle.Default, "cell");
            cellTableViewCell.Cell = item;
            cellTableViewCell.SelectionStyle = UITableViewCellSelectionStyle.None;

            var textColor = ((Xamarin.Forms.Color)new TrackTextColorConverter ()
                .Convert (viewModel.Track, typeof(Xamarin.Forms.Color), 
                    null, CultureInfo.CurrentCulture))
                .ToUIColor ();

            cellTableViewCell.AddSubview (CreateBackgroundView (cellTableViewCell.Bounds, viewModel));

            if (viewModel.IsBooked) {
                cellTableViewCell.AddSubview (CreateTitleLabel (viewModel, textColor));
                cellTableViewCell.AddSubview (CreateLocationLabel (viewModel, textColor));
                cellTableViewCell.AddSubview (CreateTrackLabel (viewModel, textColor));
            } else {
                cellTableViewCell.AddSubview (CreateChooseLabel ());
                cellTableViewCell.AddSubview (CreateAddIcon ());
            }

            cellTableViewCell.AddSubview (CreateTimeLabel (viewModel, textColor));
            cellTableViewCell.AddSubview (CreateAMPMLabel (viewModel, textColor));

            this.UpdateBackground (cellTableViewCell, item);
            return cellTableViewCell;
        }
开发者ID:vgvassilev,项目名称:couchbase-connect-14,代码行数:30,代码来源:AgendaCellRenderer.cs

示例5: GetCellCore

        protected override View GetCellCore(Cell item, View convertView, ViewGroup parent, Context context)
        {
            var inflatorservice = (LayoutInflater)Forms.Context.GetSystemService(Android.Content.Context.LayoutInflaterService);
            var dataContext = item.BindingContext as EventViewModel;

            var textMsgVm = dataContext as TextMessageViewModel;
            if (textMsgVm != null)
            {
                if (textMsgVm.ImageId.HasValue)
                {
                    var template = (LinearLayout)inflatorservice.Inflate(textMsgVm.IsMine ? Resource.Layout.image_item_owner : Resource.Layout.image_item_opponent, null, false);
                    //template.FindViewById<TextView>(Resource.Id.timestamp).Text = textMsgVm.Timestamp.ToString("HH:mm");
                    template.FindViewById<TextView>(Resource.Id.nick).Text = textMsgVm.IsMine ? "Me:" : textMsgVm.AuthorName + ":";
                    template.FindViewById<ImageView>(Resource.Id.image).SetImageBitmap(GetImageBitmapFromUrl(textMsgVm.ImageUrl));
                    return template;
                }
                else
                {
                    var template = (LinearLayout)inflatorservice.Inflate(textMsgVm.IsMine ? Resource.Layout.message_item_owner : Resource.Layout.message_item_opponent, null, false);
                    //template.FindViewById<TextView>(Resource.Id.timestamp).Text = textMsgVm.Timestamp.ToString("HH:mm");
                    template.FindViewById<TextView>(Resource.Id.nick).Text = textMsgVm.IsMine ? "Me:" : textMsgVm.AuthorName + ":";
                    template.FindViewById<TextView>(Resource.Id.message).Text = textMsgVm.Text;
                    return template;
                }
            }

            return base.GetCellCore(item, convertView, parent, context);
        }
开发者ID:alancaetano,项目名称:AgendaOnline,代码行数:28,代码来源:MessageRenderer.cs

示例6: GetCell

        public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
        {
            var viewCell = (ViewCellExtended)item;

            var cell = base.GetCell(item, reusableCell, tv);
            if (cell != null)
            {
                cell.SelectionStyle = viewCell.IsHighlightSelection ? UITableViewCellSelectionStyle.Default : UITableViewCellSelectionStyle.None;


                if (viewCell.SelectColor != Color.Transparent)
                {
                    if (selView == null)
                    {
                        selView = new UIView(cell.SelectedBackgroundView.Bounds);
                        selView.BackgroundColor = new UIColor((nfloat)viewCell.SelectColor.R, (nfloat)viewCell.SelectColor.G, (nfloat)viewCell.SelectColor.B, (nfloat)viewCell.SelectColor.A);
                        //selView.Layer.BackgroundColor = UIColor.Blue;
                        //selView.Layer.BorderColor = UIColor.Yellow;
                        //selView.Layer.BorderWidth = 2.0f;
                    }

                    cell.SelectedBackgroundView = selView;
                }
            }

            return cell;
        }
开发者ID:asthanarht,项目名称:XamarinDiscountsApp,代码行数:27,代码来源:ViewCellExtendedRenderer.cs

示例7: GetCellCore

		protected override View GetCellCore (Cell item, View convertView, ViewGroup parent, Context context)
		{
			var cell = (LinearLayout)base.GetCellCore (item, convertView, parent, context);
			cell.SetPadding(20, 10, 0, 10);
			cell.DividerPadding = 50;

			var div = new ShapeDrawable();
			div.SetIntrinsicHeight(1);
			//div.Paint.Set(new Paint { Color = Color.FromHex("00FFFFFF").ToAndroid() });

			if (parent is ListView) {
				((ListView)parent).Divider = div;
				((ListView)parent).DividerHeight = 1;
			}


			var label = (TextView)((LinearLayout)cell.GetChildAt(1)).GetChildAt(0);
			label.SetTextColor(Color.FromHex("000000").ToAndroid());
			label.TextSize = Font.SystemFontOfSize(NamedSize.Large).ToScaledPixel();

			var secondaryLabel = (TextView)((LinearLayout)cell.GetChildAt(1)).GetChildAt(1);
			secondaryLabel.SetTextColor(Color.FromHex("738182").ToAndroid());
			secondaryLabel.TextSize = Font.SystemFontOfSize(NamedSize.Medium).ToScaledPixel();


			return cell;
		}
开发者ID:johanclawson,项目名称:Hanselman.Forms,代码行数:27,代码来源:ListCellRenderer.cs

示例8: GetCellCore

        protected override View GetCellCore (Cell item, View convertView, ViewGroup parent, Context context)
        {
            var cell = (LinearLayout)base.GetCellCore (item, convertView, parent, context);
            cell.SetPadding(20, 10, 0, 10);
            cell.DividerPadding = 50;

            var div = new ShapeDrawable();
            div.SetIntrinsicHeight(1);

            div.Paint.Set(new Paint { Color = MobileCRM.Shared.Helpers.AppColors.SEPARATOR.ToAndroid() });


            if (parent is ListView) {
                ((ListView)parent).Divider = div;
                ((ListView)parent).DividerHeight = 1;
            }


            var label = (TextView)((LinearLayout)cell.GetChildAt(1)).GetChildAt(0);


            label.SetTextColor(MobileCRM.Shared.Helpers.AppColors.LABELWHITE.ToAndroid());

            
            label.TextSize = Font.SystemFontOfSize(NamedSize.Large).ToScaledPixel();

            var secondaryLabel = (TextView)((LinearLayout)cell.GetChildAt(1)).GetChildAt(1);

            secondaryLabel.SetTextColor(MobileCRM.Shared.Helpers.AppColors.LABELBLUE.ToAndroid());
           
            secondaryLabel.TextSize = Font.SystemFontOfSize(NamedSize.Medium).ToScaledPixel();


            return cell;
        }
开发者ID:njmube,项目名称:VervetaCRM,代码行数:35,代码来源:ListTextCellRenderer.cs

示例9: GetCell

 public override UIKit.UITableViewCell GetCell(Cell item, UIKit.UITableViewCell reusableCell,
     UIKit.UITableView tv)
 {
     var cell = base.GetCell(item, reusableCell, tv);
     cell.Accessory = CellAccessoryHelper.GetCellAccessory(item.StyleId);
     return cell;
 }
开发者ID:unger,项目名称:ArtportalenApp,代码行数:7,代码来源:StandardViewCellRenderer.cs

示例10: GetCellCore

		protected override View GetCellCore (Cell item, View convertView, ViewGroup parent, Context context)
		{
			var cell = (LinearLayout)base.GetCellCore(item, convertView, parent, context);
			cell.SetPadding(20, 30, 0, 30);
			cell.DividerPadding = 50;

			var div = new ShapeDrawable();
			div.SetIntrinsicHeight(1);
			div.Paint.Set(new Paint { Color = Color.FromHex("00FFFFFF").ToAndroid() });

			if (parent is ListView)
			{
				((ListView)parent).Divider = div;
				((ListView)parent).DividerHeight = 1;
			}

			var image = (ImageView)cell.GetChildAt(0);
			image.SetScaleType(ImageView.ScaleType.FitCenter);

			image.LayoutParameters.Width = 60;
			image.LayoutParameters.Height = 60;

			var linear = (LinearLayout)cell.GetChildAt(1);
			linear.SetGravity(GravityFlags.CenterVertical);

			var label = (TextView)linear.GetChildAt(0);
			label.SetTextColor(Color.White.ToAndroid());
			label.TextSize = Font.SystemFontOfSize(NamedSize.Medium).ToScaledPixel() * 1.25f;
			label.Gravity = (GravityFlags.CenterVertical);
			label.SetTextColor(Color.FromHex("FFFFFF").ToAndroid());
			var secondaryLabel = (TextView)linear.GetChildAt(1);
			secondaryLabel.Visibility = ViewStates.Gone;

			return cell;
		}
开发者ID:jsnmgpnty,项目名称:Blogness2.0,代码行数:35,代码来源:ListImageCellRenderer.cs

示例11: GetCellCore

        protected override Android.Views.View GetCellCore(Cell item, Android.Views.View convertView, Android.Views.ViewGroup parent, Android.Content.Context context)
        {
            var cell = (TextLabelCell)item;

            var view = convertView;

            if (view == null) {
                view = (context as Activity).LayoutInflater.Inflate(Resource.Layout.cell, null);
            }

            TextView label =  (Android.Widget.TextView)view.FindViewById (Resource.Id.textLabel);
            label.Text = cell.Label;

            label.SetTextColor (cell.LabelColor.ToAndroid ());

            if (cell.XAlign == Xamarin.Forms.TextAlignment.Center) {
                label.Gravity = GravityFlags.Center;
            }

            // Detail on the right
            TextView DetailText = (Android.Widget.TextView) view.FindViewById (Resource.Id.detailTextLabel);

            if (cell.Text != null)
                DetailText.Text = cell.Text;
            else
                DetailText.Visibility = Android.Views.ViewStates.Invisible;

            view.SetBackgroundColor (cell.BackgroundColor.ToAndroid ());

            return view;
        }
开发者ID:zgszft,项目名称:UTSHelpsMobile,代码行数:31,代码来源:TextLabelAndroidCellRenderer.cs

示例12: GetCellCore

		protected override Android.Views.View GetCellCore (Cell item, Android.Views.View convertView, Android.Views.ViewGroup parent, Android.Content.Context context) {
			var cell = (LinearLayout)base.GetCellCore (item, convertView, parent, context);
			var label = (TextView)((LinearLayout)cell.GetChildAt(1)).GetChildAt(0);
			Typeface font = Typeface.CreateFromAsset (Forms.Context.Assets, "HelveticaTEDBold.otf");
			label.Typeface = font;
			return cell;
		}
开发者ID:luis-villase,项目名称:MxApp,代码行数:7,代码来源:BaseImageCellRenderer.cs

示例13: GetCell

        public override UITableViewCell GetCell(Cell item, UITableView tv)
        {
            var extendedCell = (ExtendedViewCell)item;
            var cell = base.GetCell (item, tv);
            if (cell != null) {
                cell.BackgroundColor = extendedCell.BackgroundColor.ToUIColor ();
                cell.SeparatorInset = new UIEdgeInsets ((float)extendedCell.SeparatorPadding.Top, (float)extendedCell.SeparatorPadding.Left,
                    (float)extendedCell.SeparatorPadding.Bottom, (float)extendedCell.SeparatorPadding.Right);

                if (extendedCell.ShowDisclousure) {
                    cell.Accessory = MonoTouch.UIKit.UITableViewCellAccessory.DisclosureIndicator;
                    if (!string.IsNullOrEmpty (extendedCell.DisclousureImage)) {
                        var detailDisclosureButton = UIButton.FromType (UIButtonType.Custom);
                        detailDisclosureButton.SetImage (UIImage.FromBundle (extendedCell.DisclousureImage), UIControlState.Normal);
                        detailDisclosureButton.SetImage (UIImage.FromBundle (extendedCell.DisclousureImage), UIControlState.Selected);

                        detailDisclosureButton.Frame = new RectangleF (0f, 0f, 30f, 30f);
                        detailDisclosureButton.TouchUpInside += (object sender, EventArgs e) => {
                            var index = tv.IndexPathForCell (cell);
                            tv.SelectRow (index, true, UITableViewScrollPosition.None);
                            tv.Source.AccessoryButtonTapped (tv, index);
                        };
                        cell.AccessoryView = detailDisclosureButton;
                    }
                }
            }

            if(!extendedCell.ShowSeparator)
                tv.SeparatorStyle = UITableViewCellSeparatorStyle.None;

            tv.SeparatorColor = extendedCell.SeparatorColor.ToUIColor();

            return cell;
        }
开发者ID:khuatt,项目名称:Xamarin-Forms-Labs,代码行数:34,代码来源:ExtendedViewCellRenderer.cs

示例14: GetCell

 // Get the cell and add the disclosure indicator if the bindable property was set to true.
 public override UITableViewCell GetCell(Cell item,  UITableViewCell reusableCell, UITableView tv)
 {
     var cell = base.GetCell (item, reusableCell, tv);
     if( ( (DisclosureImageCell) item ).DisclosureEnabled)
         cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
     return cell;
 }
开发者ID:jfuji6,项目名称:XamarinDemo,代码行数:8,代码来源:DisclosureImageCellRenderer.cs

示例15: GetCell

		public override UITableViewCell GetCell (Cell item, UITableViewCell reusableCell, UITableView tv)
		{
            var extendedCell = (ExtendedViewCell) item;
            _tableView = _tableView ?? tv;

			var cell = base.GetCell(item, reusableCell, tv);
            if (cell != null)
            {
                cell.SelectionStyle = extendedCell.HighlightSelection ? UITableViewCellSelectionStyle.Default : UITableViewCellSelectionStyle.None;

                cell.BackgroundColor = extendedCell.BackgroundColor.ToUIColor();
                cell.SeparatorInset = new UIEdgeInsets((float) extendedCell.SeparatorPadding.Top, (float) extendedCell.SeparatorPadding.Left,
                    (float) extendedCell.SeparatorPadding.Bottom, (float) extendedCell.SeparatorPadding.Right);
                SetDiscolosure(extendedCell, cell);

                if (!_cellMappings.ContainsKey(extendedCell))
                    extendedCell.PropertyChanged += ExtendedCellOnPropertyChanged;

                _cellMappings[extendedCell] = cell;
            }
            if (!extendedCell.ShowSeparator)
                tv.SeparatorStyle = UITableViewCellSeparatorStyle.None;
            tv.SeparatorColor = extendedCell.SeparatorColor.ToUIColor();
            return cell;
        }
开发者ID:jimbobbennett,项目名称:JimLib.Xamarin,代码行数:25,代码来源:ExtendedViewCellRenderer.cs


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