本文整理汇总了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);
}
示例2: Initialize
private void Initialize()
{
var text = new TextView(Context);
text.SetHeight(500);
text.SetWidth(200);
text.SetText(Resource.String.FooWidgetText);
AddView(text);
}
示例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);
}
示例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;
}
示例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);
示例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);
}