本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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();
}
}