本文整理汇总了C#中View.findViewById方法的典型用法代码示例。如果您正苦于以下问题:C# View.findViewById方法的具体用法?C# View.findViewById怎么用?C# View.findViewById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View.findViewById方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainAppViewHolder
public MainAppViewHolder(View itemView) : base(itemView)
{
mDeviceLayout = (LinearLayout) itemView.findViewById(R.id.device_root_layout);
mDeviceOpenActions = (LinearLayout) itemView.findViewById(R.id.device_buttons);
mDeviceActions = (LinearLayout) itemView.findViewById(R.id.device_action_layout);
mDeviceVolumes = (LinearLayout) itemView.findViewById(R.id.device_volumes_layout);
}
示例2: OrdinalAppViewHolder
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public OrdinalAppViewHolder(final FcContext context, android.view.View itemView, FcAdapter adapter)
public OrdinalAppViewHolder(FcContext context, View itemView, FcAdapter adapter) : base(itemView)
{
mDeviceAppButton = (ImageButton) itemView.findViewById(R.id.device_app_button);
mDeviceRootLayout = (LinearLayout) itemView.findViewById(R.id.device_root_layout);
mDeviceOpenActions = (LinearLayout) itemView.findViewById(R.id.device_open_actions);
mDeviceActions = (LinearLayout) itemView.findViewById(R.id.device_actions);
mDeviceVolumeActions = (LinearLayout) itemView.findViewById(R.id.device_volume_actions);
mDeviceVolumes = (LinearLayout) itemView.findViewById(R.id.device_volumes);
mDeviceVolumesLabel = (TextView) itemView.findViewById(R.id.device_volume_label);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final FcAnimator animator = new FcAnimator();
FcAnimator animator = new FcAnimator();
mExpandActionsButtonListener = new AppClickedListener(this, adapter);
mOpenAppDirectlyButtonListener = new OnClickListenerAnonymousInnerClassHelper(this, context, animator);
mDeviceAppButton.OnClickListener = mExpandActionsButtonListener;
}
示例3: getView
public override View getView(int position, View currentView, ViewGroup parent)
{
if (currentView == null)
{
currentView = inflater.inflate(R.layout.city_listitem, parent, false);
}
City city = cities[position];
if (city != null)
{
((TextView) currentView.findViewById(R.id.name)).Text = city.Name;
((TextView) currentView.findViewById(R.id.votes)).Text = Convert.ToString(city.Votes);
}
return currentView;
}
示例4: ViewHolder
internal ViewHolder(AsyncQueryFragment.DotAdapter outerInstance, View view)
{
this.outerInstance = outerInstance;
text = (TextView) view.findViewById(android.R.id.text1);
}
示例5: showMoveCursorDialog
private void showMoveCursorDialog()
{
if (mMoveCursorDialog == null)
{
mView = mLayoutInflater.inflate(R.layout.dialog_move_cursor, null);
Button button = (Button) mView.findViewById(R.id.button1);
button.OnClickListener = this;
button = (Button) mView.findViewById(R.id.button2);
button.OnClickListener = this;
button = (Button) mView.findViewById(R.id.button3);
button.OnClickListener = this;
button = (Button) mView.findViewById(R.id.button4);
button.OnClickListener = this;
button = (Button) mView.findViewById(R.id.button5);
button.OnClickListener = this;
button = (Button) mView.findViewById(R.id.button6);
button.OnClickListener = this;
button = (Button) mView.findViewById(R.id.button7);
button.OnClickListener = this;
button = (Button) mView.findViewById(R.id.button8);
button.OnClickListener = this;
button = (Button) mView.findViewById(R.id.button9);
button.OnClickListener = this;
mMoveCursorDialog = (new AlertDialog.Builder(MainActivity.this)).setView(mView).setNegativeButton("Close", new OnClickListenerAnonymousInnerClassHelper(this))
.create();
}
mMoveCursorDialog.show();
mBcd.Cursor = true;
}
示例6: getView
public override View getView(int i, View convertView, ViewGroup viewGroup)
{
int direction = getItemViewType(i);
if (convertView == null)
{
int res = 0;
if (direction == DIRECTION_INCOMING)
{
res = R.layout.message_right;
}
else if (direction == DIRECTION_OUTGOING)
{
res = R.layout.message_left;
}
convertView = mInflater.inflate(res, viewGroup, false);
}
Message message = mMessages[i].first;
string name = message.SenderId;
TextView txtSender = (TextView) convertView.findViewById(R.id.txtSender);
TextView txtMessage = (TextView) convertView.findViewById(R.id.txtMessage);
TextView txtDate = (TextView) convertView.findViewById(R.id.txtDate);
txtSender.Text = name;
txtMessage.Text = message.TextBody;
txtDate.Text = mFormatter.format(message.Timestamp);
return convertView;
}
示例7: prepareView
/// <summary>
/// @brief This method was c </summary>
/// <param name="root"> </param>
/// <param name="array"> </param>
public virtual void prepareView(View root, TypedArray array)
{
View dragReceiver = root.findViewById(R.id.for_content);
OnDragListener dragListener = new OnDragListenerAnonymousInnerClassHelper(this);
int barAlignment = array.getInt(R.styleable.FloatingControler_bar_alignment, ALIGN_PARENT_BOTTOM_RIGHT);
mBarInitialAlignment = barAlignment;
if (dragReceiver != null)
{
dragReceiver.OnDragListener = dragListener;
}
root.OnDragListener = dragListener;
mMainView = (ViewGroup) root;
mMainAppImage.Id = Context.GetHashCode();
mDevicesActionLayoutWidth = mFcContext.getDimension(R.dimen.floating_controller_actions_length);
putBarOnBoard(barAlignment);
}
示例8: defineNvImage
private void defineNvImage(View view)
{
try
{
EditText editText = (EditText) findViewById(R.id.editText1);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int level = Integer.parseInt(editText.getText().toString());
int level = int.Parse(editText.Text.ToString());
editText = (EditText) view.findViewById(R.id.editText1);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int keyCode = Integer.parseInt(editText.getText().toString());
int keyCode = int.Parse(editText.Text.ToString());
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String pathName = mTextView.getText().toString();
string pathName = mTextView.Text.ToString();
if (pathName != null && pathName.Length > 0)
{
MainActivity.mBixolonPrinter.defineNvImage(pathName, BixolonPrinter.BITMAP_WIDTH_NONE, level, keyCode);
}
else
{
BitmapDrawable drawable = (BitmapDrawable) Resources.getDrawable(R.drawable.bixolon);
Bitmap bitmap = drawable.Bitmap;
MainActivity.mBixolonPrinter.defineNvImage(bitmap, BixolonPrinter.BITMAP_WIDTH_NONE, level, keyCode);
}
}
catch (System.FormatException e)
{
Console.WriteLine(e.ToString());
Console.Write(e.StackTrace);
Toast.makeText(ApplicationContext, "Please input key code or level.", Toast.LENGTH_SHORT).show();
}
}
示例9: getView
public override View getView(int position, View convertView, ViewGroup parent)
{
ImageView icon;
TextView name, size, date;
if (convertView == null)
{
convertView = inflater.inflate(R.layout.item, null);
icon = (ImageView) convertView.findViewById(R.id.icon);
name = (TextView) convertView.findViewById(R.id.name);
size = (TextView) convertView.findViewById(R.id.size);
date = (TextView) convertView.findViewById(R.id.date);
convertView.setTag(R.id.icon, icon);
convertView.setTag(R.id.name, name);
convertView.setTag(R.id.size, size);
convertView.setTag(R.id.date, date);
}
else
{
icon = (ImageView) convertView.getTag(R.id.icon);
name = (TextView) convertView.getTag(R.id.name);
size = (TextView) convertView.getTag(R.id.size);
date = (TextView) convertView.getTag(R.id.date);
}
SmcItem item = getItem(position);
//set title
name.Text = item.Title;
//set size
if (item.MediaType == SmcItem.MEDIA_TYPE_ITEM_FOLDER)
{
size.Text = "<DIR>";
}
else
{
size.Text = getSize(item.FileSize);
}
//set date
if (item.Date != null)
{
date.Text = dateFormat.format(item.Date);
}
else
{
date.Text = null;
}
//load icon
Uri iconPath = item.Thumbnail;
icon.Tag = iconPath;
if (iconPath != null)
{
Bitmap b = IconCache.Instance.get(iconPath);
if (b == null)
{
// Clear the image so we don't display stale icon.
icon.ImageResource = getIconForItem(item);
(new IconLoader(icon)).execute(iconPath);
}
else
{
icon.ImageBitmap = b;
}
}
else
{
icon.ImageResource = getIconForItem(item);
}
return convertView;
}