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


C# LinearLayout.addView方法代码示例

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


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

示例1: showChannelInputDialog

//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: private void showChannelInputDialog(final int interfaceType)
		private void showChannelInputDialog(int interfaceType)
		{
			// Dialog to input the name of channel to join.

			LinearLayout mlayout = new LinearLayout(this);
			LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
			mlayout.LayoutParams = lp;
			mlayout.Orientation = LinearLayout.VERTICAL;

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.widget.EditText input = new android.widget.EditText(this);
			EditText input = new EditText(this);
			LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
			input.LayoutParams = lp2;
			input.Hint = CHORD_SECURE_TEST_CHANNEL;
			input.LongClickable = false;
			input.MaxHeight = 500;
			input.OnTouchListener = new OnTouchListenerAnonymousInnerClassHelper(this);

			// Set checkBox to use secure channel
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.widget.CheckBox mCheck = new android.widget.CheckBox(this);
			CheckBox mCheck = new CheckBox(this);
			mCheck.Text = "Use Secure Channel";
			mCheck.TextColor = Color.BLACK;

			/// <summary>
			///*******************************************************************
			/// 5. If you want to use secured channel, add prefix to your channel
			/// name SECURE_PREFIX : Prefix to secured channel name
			/// ********************************************************************
			/// </summary>

			// Get keyboard inputs to add prefix to secured channel name
			input.addTextChangedListener(new TextWatcherAnonymousInnerClassHelper(this, input, mCheck));

			// Get Change of CheckBox to add prefix to secured channel name
			mCheck.OnCheckedChangeListener = new OnCheckedChangeListenerAnonymousInnerClassHelper(this, input);

			mlayout.addView(input);
			mlayout.addView(mCheck);

			AlertDialog alertDialog = (new AlertDialog.Builder(this, AlertDialog.THEME_HOLO_LIGHT)).setTitleuniquetempvar.setMessage([email protected]_channel_name).setView(mlayout).setPositiveButton([email protected], new OnClickListenerAnonymousInnerClassHelper(this, interfaceType, input, mCheck))
				   .setNegativeButton([email protected], new OnClickListenerAnonymousInnerClassHelper2(this, input))
				   .create();
			alertDialog.show();
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:49,代码来源:UseSecureChannelActivity.cs

示例2: addBypassAction

//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: private void addBypassAction(FcContext fcContext, android.widget.LinearLayout linearLayout, final FcActionItem fcActionItem, int buttonText)
		private void addBypassAction(FcContext fcContext, LinearLayout linearLayout, FcActionItem fcActionItem, int buttonText)
		{
			Button bypassButton = (Button) LayoutInflater.from(fcContext.Context).inflate(R.layout.bypass_action_button, mDeviceActions, false);

	//        bypassButton.setBackground(fcActionItem.getIcon(fcContext));
			bypassButton.Enabled = fcActionItem.Enabled;
			bypassButton.Visibility = fcActionItem.Visible ? View.VISIBLE : View.GONE;
			bypassButton.Text = fcContext.Context.Resources.getString(buttonText);
			bypassButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this, fcActionItem);

			DrawableTool.setBackground(bypassButton, 0, 1, fcContext);
			linearLayout.addView(bypassButton);
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:15,代码来源:OrdinalAppViewHolder.cs

示例3: addActionButton

//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: private void addActionButton(final android.widget.LinearLayout linearLayout, final FcActionItem fcActionItem, final int resId, final int index, final int numberOfElements, final FcContext fcContext, final boolean adjustBackgroundToPositionInLayout)
		private void addActionButton(LinearLayout linearLayout, FcActionItem fcActionItem, int resId, int index, int numberOfElements, FcContext fcContext, bool adjustBackgroundToPositionInLayout)
		{
			ImageButton imageButton = (ImageButton) LayoutInflater.from(fcContext.Context).inflate(resId, mDeviceActions, false);
			imageButton.ImageDrawable = fcActionItem.getIcon(fcContext);
			imageButton.Enabled = fcActionItem.Enabled;
			imageButton.Visibility = fcActionItem.Visible ? View.VISIBLE : View.GONE;
			imageButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper3(this, fcActionItem);

			if (adjustBackgroundToPositionInLayout)
			{
				DrawableTool.setBackground(imageButton, index, numberOfElements, fcContext);
			}

			linearLayout.addView(imageButton);
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:17,代码来源:OrdinalAppViewHolder.cs

示例4: prepareActionButtons

//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: private void prepareActionButtons(final FcContext context, java.util.List<FcActionItem> actions, android.widget.LinearLayout parent)
		private void prepareActionButtons(FcContext context, IList<FcActionItem> actions, LinearLayout parent)
		{
			int i = 0;
			foreach (FcActionItem action in actions)
			{
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.widget.ImageButton button = context.inflate(com.samsung.android.sdk.professionalaudio.widgets.R.layout.fc_main_action_button, parent);
				ImageButton button = context.inflate(R.layout.fc_main_action_button, parent);

				button.ImageDrawable = action.getIcon(context);
				button.Enabled = action.Enabled;
				button.Visibility = action.Visible ? View.VISIBLE : View.GONE;
				button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this);
				int index = i;
				if (parent.LayoutDirection == View.LAYOUT_DIRECTION_RTL)
				{
					index = actions.Count - index - 1;
				}
				DrawableTool.setBackground(button, index, actions.Count, context);

				parent.addView(button);
				i++;
			}
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:26,代码来源:MainAppViewHolder.cs


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