本文整理汇总了C#中Spinner.SetPadding方法的典型用法代码示例。如果您正苦于以下问题:C# Spinner.SetPadding方法的具体用法?C# Spinner.SetPadding怎么用?C# Spinner.SetPadding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spinner
的用法示例。
在下文中一共展示了Spinner.SetPadding方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPropertyWindowLayout
public override Android.Views.View GetPropertyWindowLayout (Android.Content.Context context)
{
View view = new View (context);
Spinner spin = new Spinner (context);
List<String> adapter = new List<String> (){"Single","Single/Deselect","Multiple","None" };
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>
(context, Android.Resource.Layout.SimpleSpinnerItem,adapter);
spin.Adapter = dataAdapter;
TextView txt = new TextView (context);
txt.Text = "Set Selection Mode";
txt.TextSize = 15f;
txt.SetPadding (10, 10, 10, 10);
spin.SetPadding (10, 10, 10, 10);
LinearLayout linear = new LinearLayout (context);
linear.Orientation = Orientation.Horizontal;
linear.AddView (txt);
linear.AddView (spin);
spin.SetSelection(2);
spin.ItemSelected += OnSelectionModeChanged;
return linear;
}
示例2: GetPropertyWindowLayout
public override View GetPropertyWindowLayout (Android.Content.Context context)
{
LinearLayout linear = new LinearLayout (context);
linear.Orientation = Orientation.Horizontal;
TextView txt = new TextView (context);
txt.Text = "Select Theme";
txt.SetPadding (10, 10, 10, 10);
txt.TextSize = 15f;
Spinner themeDropDown = new Spinner (context);
List<String> adapter = new List<String> (){"Default","Dark","Blue","Red","Green" };
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>
(context, Android.Resource.Layout.SimpleSpinnerItem,adapter);
themeDropDown.Adapter = dataAdapter;
themeDropDown.SetPadding (10, 10, 10, 10);
themeDropDown.SetSelection(1);
themeDropDown.ItemSelected += OnGridThemeChanged;
themeDropDown.SetMinimumHeight (70);
linear.AddView (txt);
linear.AddView (themeDropDown);
return linear;
}
示例3: GetPropertyWindowLayout
public override View GetPropertyWindowLayout (Android.Content.Context context)
{
int width = context.Resources.DisplayMetrics.WidthPixels / 2;
propertylayout = new LinearLayout (context);
propertylayout.Orientation = droid.Vertical;
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams (
width * 2, 5);
layoutParams.SetMargins (0, 5, 0, 0);
TextView textView1 = new TextView (context);
textView1.Text = " " + "TICK PLACEMENT";
textView1.TextSize = 15;
textView1.Typeface = Typeface.Create("Roboto", TypefaceStyle.Normal);
textView1.SetTextColor (Color.White);
textView1.Gravity = GravityFlags.Left;
TextView textview2 = new TextView (context);
textview2.SetHeight (14);
propertylayout.AddView (textview2);
tickSpinner = new Spinner (context);
tickSpinner.SetPadding (0, 0, 0, 0);
propertylayout.AddView (textView1);
SeparatorView separate = new SeparatorView (context, width * 2);
separate.LayoutParameters = new ViewGroup.LayoutParams (width * 2, 5);
propertylayout.AddView (separate, layoutParams);
TextView textview8 = new TextView (context);
textview8.SetHeight (20);
propertylayout.AddView (textview8);
propertylayout.AddView (tickSpinner);
TextView textview3 = new TextView (context);
propertylayout.AddView (textview3);
List<String> list = new List<String> ();
list.Add ("BottomRight");
list.Add ("TopLeft");
list.Add ("Outside");
list.Add ("Inline");
list.Add ("None");
dataAdapter = new ArrayAdapter<String> (context, Android.Resource.Layout.SimpleSpinnerItem, list);
dataAdapter.SetDropDownViewResource (Android.Resource.Layout.SimpleSpinnerDropDownItem);
tickSpinner.Adapter = dataAdapter;
tickSpinner.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => {
String selectedItem = dataAdapter.GetItem (e.Position);
if (selectedItem.Equals ("BottomRight")) {
tickplacement = TickPlacement.BottomRight;
} else if (selectedItem.Equals ("TopLeft")) {
tickplacement = TickPlacement.TopLeft;
} else if (selectedItem.Equals ("Inline")) {
tickplacement = TickPlacement.Inline;
} else if (selectedItem.Equals ("Outside")) {
tickplacement = TickPlacement.Outside;
} else if (selectedItem.Equals ("None")) {
tickplacement = TickPlacement.None;
}
};
TextView textView3 = new TextView (context);
textView3.Text = " " + "LABEL PLACEMENT";
textView3.Typeface = Typeface.Create("Roboto", TypefaceStyle.Normal);
textView3.Gravity = GravityFlags.Left;
textView3.TextSize = 15;
textView3.SetTextColor (Color.White);
List<String> labelList = new List<String> ();
labelList.Add ("BottomRight");
labelList.Add ("TopLeft");
labelSpinner = new Spinner (context);
labelSpinner.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => {
String selectedItem = dataAdapter.GetItem (e.Position);
if (selectedItem.Equals ("TopLeft")) {
valueplacement = ValuePlacement.TopLeft;
} else if (selectedItem.Equals ("BottomRight")) {
valueplacement = ValuePlacement.BottomRight;
}
};
labelAdapter = new ArrayAdapter<String> (context, Android.Resource.Layout.SimpleSpinnerItem, labelList);
labelAdapter.SetDropDownViewResource (Android.Resource.Layout.SimpleSpinnerDropDownItem);
labelSpinner.Adapter = labelAdapter;
labelSpinner.SetPadding (0, 0, 0, 0);
//.........这里部分代码省略.........