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


C# View.SetTag方法代码示例

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


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

示例1: GetView

        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var item = items[position];

            ViewHolder holder;

            if (convertView == null)
            {
                convertView = context.LayoutInflater.Inflate(lay, parent, false) as LinearLayout;

                holder = new ViewHolder();
                holder.ImageItem = convertView.FindViewById<ImageView>(imageItem);
                holder.TextTop = convertView.FindViewById<TextView>(textTop);
                holder.TextBottom = convertView.FindViewById<TextView>(textBottom);
                holder.position = position;
                convertView.SetTag(lay, holder);
            }

            holder = (ViewHolder)convertView.GetTag(lay);

                if (interop.imgs.ContainsKey(item.created_at))
                    holder.ImageItem.SetImageBitmap(interop.imgs[item.created_at]);
                else holder.ImageItem.SetImageResource(Resource.Drawable.avatar_sample);

                holder.TextTop.SetText(item.from_user_name, TextView.BufferType.Normal);
                holder.TextBottom.SetText((item.text.Length < 30) ? item.text : item.text.Substring(0, 30) + "...", TextView.BufferType.Normal);

            return convertView;
        }
开发者ID:JonyferBlack,项目名称:mySharpBot,代码行数:29,代码来源:activity_side.cs

示例2: GetView

        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            if (convertView == null) {
                if (_inflater == null) {
                    _inflater = LayoutInflater.FromContext (_context);
                }

                _cell = new Cell ();
                convertView = _inflater.Inflate (Resource.Layout.treeview_cell_layout, parent, false);
                _cell.icon = convertView.FindViewById<ImageView> (Resource.Id.icon);
                _cell.title = convertView.FindViewById <TextView> (Resource.Id.title);

                convertView.SetTag (Resource.Layout.treeview_cell_layout, _cell);
            } else {
                _cell = (Cell)convertView.GetTag (Resource.Layout.treeview_cell_layout);
            }

            if (_nodes [position].hasChild) {
                if (_nodes [position].nodeType == "folder") {
                    _cell.icon.SetImageResource (Resource.Drawable.folder);
                }else{
                    _cell.icon.SetImageResource (Resource.Drawable.file);
                }
                _cell.icon.Visibility = ViewStates.Visible;
            } else {
                _cell.icon.SetImageResource (Resource.Drawable.folder);
                _cell.icon.Visibility = ViewStates.Visible;
            }

            _cell.title.Text = _nodes [position].title;
            _cell.icon.SetPadding (25*(_nodes[position].level),0,0,0);

            return convertView;
        }
开发者ID:WenF,项目名称:TreeView_Xamarin_Android,代码行数:34,代码来源:TreeViewAdapter.cs

示例3: OnViewCreated

            public View OnViewCreated(View view, Context context, IAttributeSet attrs)
            {
                if (this.Factory != null && view != null && view.GetTag(Resource.Id.MvvmCrossTagId) != TheTruth)
                {
                    // Bind here.
                    view = this.Factory.BindCreatedView(view, context, attrs);

                    view.SetTag(Resource.Id.MvvmCrossTagId, TheTruth);
                }

                return view;
            }
开发者ID:MvvmCross,项目名称:MvvmCross,代码行数:12,代码来源:MvxLayoutInflater.cs

示例4: setSelectedView

 public void setSelectedView(View v)
 {
     if (mSelectedView != null)
     {
         mSelectedView.SetTag(Resource.Id.selected_view, null);
         mSelectedView = null;
     }
     if (v != null && v.Parent != null)
     {
         mSelectedView = v;
         mSelectedView.SetTag(Resource.Id.selected_view, TAG + "SelectedView");
         Invalidate();
     }
 }
开发者ID:skywolf888,项目名称:SlidingMenu.Net,代码行数:14,代码来源:CustomViewBehind.cs


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