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


C# View.findViewById方法代码示例

本文整理汇总了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);
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:8,代码来源:MainAppViewHolder.cs

示例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;
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:22,代码来源:OrdinalAppViewHolder.cs

示例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;
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:17,代码来源:CityAdapter.cs

示例4: ViewHolder

				internal ViewHolder(AsyncQueryFragment.DotAdapter outerInstance, View view)
				{
					this.outerInstance = outerInstance;
					text = (TextView) view.findViewById(android.R.id.text1);
				}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:5,代码来源:AsyncQueryFragment.cs

示例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;
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:31,代码来源:MainActivity.cs

示例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;
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:31,代码来源:MessageAdapter.cs

示例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);
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:23,代码来源:FcControlBar.cs

示例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();
			}
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:37,代码来源:NvImageActivity.cs

示例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;
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:67,代码来源:ItemAdapter.cs


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