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


C# TextView.SetWidth方法代码示例

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


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

示例1: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            var mLayout = new FrameLayout(this);

            surface = UrhoSurface.CreateSurface(this, typeof(MySample));
            //surface.Background.SetAlpha(10);

            TextView txtView = new TextView(this);
            txtView.SetBackgroundColor(Color.Violet);
            txtView.SetWidth(10);
            txtView.SetHeight(10);

            txtView.Text = "HAHAH";
            //txtView.Text = surface.Background.ToString();
            Button btn = new Button(this);
            btn.SetBackgroundColor(Color.Transparent);
            btn.Text = "Button";
            btn.SetHeight(100);
            btn.SetWidth(100);
            btn.SetX(30);
            btn.SetY(30);
            btn.TextAlignment = TextAlignment.Center;
            mLayout.AddView(txtView);
            mLayout.AddView(btn);
            mLayout.AddView(surface);
            SetContentView(mLayout);
        }
开发者ID:ZENG-Yuhao,项目名称:Xamarin-CrossPlatform,代码行数:28,代码来源:GameActivity.cs

示例2: Initialize

 private void Initialize()
 {
     var text = new TextView(Context);
     text.SetHeight(500);
     text.SetWidth(200);
     text.SetText(Resource.String.FooWidgetText);
     AddView(text);
 }
开发者ID:alexyork-test,项目名称:Smeedee-Mobile,代码行数:8,代码来源:FooWidget.cs

示例3: OnCreateViewHolder

 public override ViewHolder OnCreateViewHolder(ViewGroup parent)
 {
     var textView = new TextView(parent.Context);
     textView.SetWidth (200);
     textView.Focusable = true;
     textView.FocusableInTouchMode = true;
     textView.Text = "";
     return new ViewHolder(textView);
 }
开发者ID:jacobduijzer,项目名称:AllOurVinyl,代码行数:9,代码来源:VideoPresenter.cs

示例4: OnCreateViewHolder

		// Create new views (invoked by the layout manager)
		public override RecyclerView.ViewHolder OnCreateViewHolder (ViewGroup parent, int viewType)
		{	
            // set the view's size, margins, paddings and layout parameters
			var tv = new TextView (parent.Context);
			tv.SetWidth (200);
			tv.Text = "";

			var vh = new MyViewHolder (tv);
			return vh;
		} 
开发者ID:Supermortal,项目名称:RiffSharer,代码行数:11,代码来源:MainActivity.cs

示例5: GetPropertyWindowLayout


//.........这里部分代码省略.........
			text3.Adapter = dataadapter1;

			text3.ItemSelected+= (object sender, AdapterView.ItemSelectedEventArgs e) => {
				String selectedItem = dataadapter1.GetItem(e.Position);
									if (selectedItem.Equals("Suggest")) {
										autoCompleteMode = AutoCompleteMode.Suggest;
										
									} else if (selectedItem.Equals("SuggestAppend")) {
										autoCompleteMode = AutoCompleteMode.SuggestAppend;
										
									} else if (selectedItem.Equals("Append")) {
										autoCompleteMode = AutoCompleteMode.Append;
										
									}
			};

			//Separator 2
			SeparatorView separate1 = new SeparatorView(context, width * 2);
			separate1.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);

			LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(
				width * 2, 5);
			layoutParams2.SetMargins(0, 20, 0, 0);
			propertylayout.SetPadding(15, 0, 15, 0);

			//Separator 2
			SeparatorView separate2 = new SeparatorView(context, width * 2);
			separate2.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
			propertylayout.AddView(separate2, layoutParams2);

			//Min Prefix Character
			TextView textView7 = new TextView(context);
			textView7.Text = "Min Prefix Character";
			textView7.SetWidth(400);
			textView7.TextSize=20;
			etext1 = new EditText(context);
			etext1.Text = "1";
			etext1.TextSize=16;
			etext1.InputType = Android.Text.InputTypes.ClassPhone;
			etext1.TextChanged+= (object sender, Android.Text.TextChangedEventArgs e) => 
			{
				if(etext1.Text.Length > 0)
					minimum =  Convert.ToInt32(e.Text.ToString());
				else
					minimum = 1;
			};

			LinearLayout.LayoutParams layoutParams7 = new LinearLayout.LayoutParams(
				ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
			layoutParams7.SetMargins(0, 10, 0, 0);
			LinearLayout.LayoutParams layoutParams8 = new LinearLayout.LayoutParams(
				ViewGroup.LayoutParams.WrapContent, 55);
			layoutParams8.SetMargins(0, 10, 0, 0);
			stackView2 = new LinearLayout(context);
			stackView2.AddView(textView7,layoutParams8);
			stackView2.AddView(etext1, layoutParams7);
			stackView2.Orientation = Orientation.Horizontal;
			propertylayout.AddView(stackView2);
			SeparatorView separate4 = new SeparatorView(context, width * 2);
			separate4.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
			LinearLayout.LayoutParams layoutParams6 = new LinearLayout.LayoutParams(width * 2, 5);
			layoutParams6.SetMargins(0, 20, 15, 0);
			propertylayout.AddView(separate4, layoutParams6);

			//max DropDown height
			TextView textView8 = new TextView(context);
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:67,代码来源:AutoComplete.cs

示例6: UpdateHeader

 public void UpdateHeader(IEnumerable<StockDataItem> configItems)
 {
     QuoteListviewHeader.RemoveAllViews();
     var cellwidth = this.GetScreenWidth() / configItems.Count();
     foreach (var stockDataItem in configItems)
     {
         var textItem = new TextView(this);
         textItem.Text = stockDataItem.GetStringValue();
         textItem.TextSize = 16.55F;
         textItem.SetWidth(cellwidth);
         textItem.SetTextColor(Resources.GetColor(Android.Resource.Color.Black));
         QuoteListviewHeader.AddView(textItem);
     }
     QuoteListviewHeader.SetBackgroundResource(Android.Resource.Color.BackgroundLight);
 }
开发者ID:mgroves,项目名称:MonodroidStockPortfolio,代码行数:15,代码来源:PortfolioActivity.cs


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