本文整理汇总了C#中Android.Widget.TextView类的典型用法代码示例。如果您正苦于以下问题:C# TextView类的具体用法?C# TextView怎么用?C# TextView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextView类属于Android.Widget命名空间,在下文中一共展示了TextView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
_output = FindViewById<TextView>(Resource.Id.output);
_ports = FindViewById<TextView>(Resource.Id.ports);
FindViewById<Button>(Resource.Id.connect).Click += connect_Click;
FindViewById<Button>(Resource.Id.disconnect).Click += disconnect_Click;
FindViewById<Button>(Resource.Id.playTone).Click += playTone_Click;
FindViewById<Button>(Resource.Id.getFwVersion).Click += getFwVersion_Click;
FindViewById<Button>(Resource.Id.turnMotorAtPower).Click += turnMotorAtPower_Click;
FindViewById<Button>(Resource.Id.turnMotorAtSpeed).Click += turnMotorAtSpeed_Click;
FindViewById<Button>(Resource.Id.stepMotorAtPower).Click += stepMotorAtPower_Click;
FindViewById<Button>(Resource.Id.stepMotorAtSpeed).Click += stepMotorAtSpeed_Click;
FindViewById<Button>(Resource.Id.timeMotorAtPower).Click += timeMotorAtPower_Click;
FindViewById<Button>(Resource.Id.timeMotorAtSpeed).Click += timeMotorAtSpeed_Click;
FindViewById<Button>(Resource.Id.stopMotor).Click += stopMotor_Click;
FindViewById<Button>(Resource.Id.setLed).Click += setLed_Click;
FindViewById<Button>(Resource.Id.playSound).Click += playSound_Click;
FindViewById<Button>(Resource.Id.draw).Click += draw_Click;
FindViewById<Button>(Resource.Id.batchNoReply).Click += batchNoReply_Click;
FindViewById<Button>(Resource.Id.batchReply).Click += batchReply_Click;
_brick = new Brick(new BluetoothCommunication());
//_brick = new Brick(new NetworkCommunication("192.168.2.237"));
_brick.BrickChanged += brick_BrickChanged;
}
示例2: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
var layout = new LinearLayout(this) {
Orientation = Orientation.Vertical
};
this.AddContentView(layout, new ViewGroup.LayoutParams(-1, -1));
this.T1 = new TextView(this);
this.T2 = new TextView(this) {
Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")
};
layout.AddView(this.T1);
layout.AddView(this.T2);
var btn = new Button(this) {
Text = "Search"
};
btn.Click += Btn_Click;
layout.AddView(btn);
this.HandleIntent(this.Intent);
}
示例3: OnCreateView
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
// Use this to return your custom view for this Fragment
// return inflater.Inflate(Resource.Layout.YourFragment, container, false);
// Lich hoc theo HK
var rootView = inflater.Inflate (Resource.Layout.LichHoc_HK, container, false);
isfirst = true;
listView_HK = rootView.FindViewById<ListView> (Resource.Id.listLH);
lbl_HK = rootView.FindViewById<TextView> (Resource.Id.lbl_HK_LH);
lbl_NH = rootView.FindViewById<TextView> (Resource.Id.lbl_NH_LH);
progress = rootView.FindViewById<ProgressBar> (Resource.Id.progressLH);
linear = rootView.FindViewById<LinearLayout>(Resource.Id.linear_HK_LH);
linearLH = rootView.FindViewById<LinearLayout>(Resource.Id.linearLH);
txtNotify = rootView.FindViewById<TextView>(Resource.Id.txtNotify_LT_HK);
// radioGroup = rootView.FindViewById<RadioGroup>(Resource.Id.radioGroup1);
bundle=this.Arguments;
check = bundle.GetBoolean ("Remind");
autoupdate = bundle.GetBoolean ("AutoUpdateData");
//load data
LoadData_HK ();
// row click
listView_HK.ItemLongClick += listView_ItemClick;
return rootView;
}
示例4: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
var display = WindowManager.DefaultDisplay;
var horiPager = new HorizontalPager(this.ApplicationContext, display);
horiPager.ScreenChanged += new ScreenChangedEventHandler(horiPager_ScreenChanged);
//You can also use:
/*horiPager.ScreenChanged += (sender, e) =>
{
System.Diagnostics.Debug.WriteLine("Switched to screen: " + ((HorizontalPager)sender).CurrentScreen);
};*/
var backgroundColors = new Color[] { Color.Red, Color.Blue, Color.Cyan, Color.Green, Color.Yellow };
for (int i = 0; i < 5; i++)
{
var textView = new TextView(this.ApplicationContext);
textView.Text = (i + 1).ToString();
textView.TextSize = 100;
textView.SetTextColor(Color.Black);
textView.Gravity = GravityFlags.Center;
textView.SetBackgroundColor(backgroundColors[i]);
horiPager.AddView(textView);
}
SetContentView(horiPager);
}
示例5: OnCreate
protected override void OnCreate (Bundle bundle)
{
dice1 = new Dice(1, 1, 6);
dice2 = new Dice(2, 1, 6);
audio = new PlayAudio (this);
base.OnCreate (bundle);
game = LbManager.GetGame(Intent.GetIntExtra ("Battle", -1), Intent.GetIntExtra("Scenario", -1));
// set our layout to be the home screen
SetContentView(Resource.Layout.General);
imgBack = FindViewById<ImageView> (Resource.Id.titleSubLbBack);
imgLb = FindViewById<ImageView> (Resource.Id.titleSubLb);
// title
txtBattleName = FindViewById<TextView>(Resource.Id.titleSubBattleName);
txtScenarioName = FindViewById<TextView>(Resource.Id.titleSubScenarioName);
imgGeneral2Die1 = FindViewById<ImageView> (Resource.Id.imgGeneral2Die1);
imgGeneral2Die2 = FindViewById<ImageView> (Resource.Id.imgGeneral2Die2);
btnGeneral2DiceRoll = FindViewById<Button>(Resource.Id.btnGeneral2DiceRoll);
imgGeneral1Die1 = FindViewById<ImageView> (Resource.Id.imgGeneral1Die1);
btnGeneral1DiceRoll = FindViewById<Button>(Resource.Id.btnGeneral1DiceRoll);
}
示例6: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
button = FindViewById<Button>(Resource.Id.GetLocationButton);
latitude = FindViewById<TextView>(Resource.Id.LatitudeText);
longitude = FindViewById<TextView>(Resource.Id.LongitudeText);
provider = FindViewById<TextView>(Resource.Id.ProviderText);
address = FindViewById<TextView>(Resource.Id.AddressText);
// MapFragment の用意と初期の場所を指定します。
// MapFragment.Map が deprecated みたいなので、正しい書き方を教えてください><
MapFragment mapFrag = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.MapFragment);
map = mapFrag.Map;
if (map != null) // Map の準備が出来たら (最初は null を返します)
{
map.MyLocationEnabled = true; // 現在地ボタン オン
map.UiSettings.ZoomControlsEnabled = true; // ズームコントロール オン
// 初期位置(カメラ)を移動
map.AnimateCamera(CameraUpdateFactory.NewCameraPosition(
new CameraPosition(
new LatLng(35.685344d, 139.753029d), // 皇居(中心位置)
12f, 0f, 0f))); // ズームレベル、方位、傾き
}
}
示例7: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.ShareLocation);
customDate = DateTime.Now;
boxProgress = FindViewById<LinearLayout> (Resource.Id.boxProgress);
boxProgress.Visibility = ViewStates.Gone;
textDate = FindViewById<TextView> (Resource.Id.textDate);
textDate.Visibility = ViewStates.Gone;
spinnerTime = FindViewById<Spinner> (Resource.Id.spinnerTime);
spinnerTime.ItemSelected += HandleItemSelected;
arrayAdapter = ArrayAdapter.CreateFromResource (this, Resource.Array.expiration_time_array, Android.Resource.Layout.SimpleSpinnerItem);
arrayAdapter.SetDropDownViewResource (Android.Resource.Layout.SimpleSpinnerDropDownItem);
spinnerTime.Adapter = arrayAdapter;
spinnerTime.SetSelection (defaultTimeIndex);
selectedTime = timeValues [defaultTimeIndex];
shareButton = FindViewById<Button> (Resource.Id.buttonShare);
shareButton.Click += HandleShareClick;
textDate.Click += delegate {
ShowDialog (0);
};
}
示例8: Initialize
void Initialize ()
{
this.LayoutParameters = new RelativeLayout.LayoutParams(-1,Configuration.getHeight (412));// LinearLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (394));
this.SetGravity(GravityFlags.Center);
image = new RelativeLayout(context);
txtDescription = new TextView (context);
txtTitle = new TextView (context);
background = new LinearLayout (context);
image.SetGravity (GravityFlags.Center);
background.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (530), Configuration.getHeight (356));
background.Orientation = Orientation.Vertical;
background.SetBackgroundColor (Color.ParseColor ("#50000000"));
image.LayoutParameters = new RelativeLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (394));
txtTitle.SetTextColor (Color.ParseColor("#ffffff"));
txtDescription.SetTextColor(Color.ParseColor("#ffffff"));
txtTitle.SetTextSize (ComplexUnitType.Px, Configuration.getHeight (40));
txtDescription.SetTextSize (ComplexUnitType.Px, Configuration.getHeight (30));
background.AddView (txtTitle);
background.AddView (txtDescription);
image.AddView (background);
this.AddView (image);
//this.AddView (background);
}
示例9: KeepMe
void KeepMe()
{
var txt = new TextView(null);
txt.Text = txt.Text;
var iv = new ImageView(null);
var obj = iv.Drawable;
var prog = new ProgressBar(null);
prog.Progress = prog.Progress;
var cb = new RadioButton(null);
cb.Checked = cb.Checked;
var np = new NumberPicker(null);
np.Value = np.Value;
var rb = new RatingBar(null);
rb.Rating = rb.Rating;
var cv = new CalendarView(null);
cv.Date = cv.Date;
var th = new TabHost(null);
th.CurrentTab = th.CurrentTab;
var tp = new TimePicker(null);
tp.CurrentHour = tp.CurrentHour;
tp.CurrentMinute = tp.CurrentMinute;
}
示例10: OnCreate
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
// Create your application here
SetContentView (Resource.Layout.DateTimePicker);
tvOutput = FindViewById<TextView> (Resource.Id.tvOutput);
btnPickDate = FindViewById<Button> (Resource.Id.btnPickDate);
/*
btnPickDate.Click += delegate {
ShowDialog (DATE_DIALOG_ID);
};
date = DateTime.Today;
*/
btnPickDate.Click += (sender, e) => ShowDialog(DATE_DIALOG_ID);
hour = DateTime.Now.Hour;
minute = DateTime.Now.Minute;
UpdateDisplay ();
}
示例11: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
_view = FindViewById<LinearLayout>(Resource.Id.parentLayout);
_text = FindViewById<TextView>(Resource.Id.logTextView);
UpdateDisplay(INITIAL_MESSAGE,Color.White);
var beaconManager = new BeaconManager(this);
indoorLocationController = new IndoorLocationController(beaconManager);
indoorLocationController.BeaconFound += HandleBeaconFound;
indoorLocationController.BeaconLost += HandleBeaconLost;
var beacon1 = DummyBeaconCreator.CreateBeaconUrsin();
var beacon2 = DummyBeaconCreator.CreateBeaconMarcel();
indoorLocationController.AddBeaconsAndStart(new List<Beacon>{beacon1,beacon2});
if (!IsBluetoothAvailable)
{
Toast.MakeText(this, "Please activate Bluetooth! iBeacons works only when Bluetooth available.",ToastLength.Long).Show();
}
}
示例12: OnCreate
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);
TextView textview = new TextView (this);
textview.Text = "This is the Connection Tab";
SetContentView (textview);
}
示例13: TimeLineViewHolder
public TimeLineViewHolder(View itemView, int viewType)
: base(itemView)
{
name = itemView.FindViewById<TextView>(Resource.Id.tx_name);
mTimelineView = itemView.FindViewById<TimelineView>(Resource.Id.time_marker);
mTimelineView.InitLine(viewType);
}
示例14: DecodeFloatElementLayout
public static void DecodeFloatElementLayout(Context context, View layout, out TextView label, out SeekBar slider,
out ImageView left, out ImageView right)
{
if (layout == null)
{
label = null;
slider = null;
left = null;
right = null;
return;
}
label =
layout.FindViewById<TextView>(context.Resources.GetIdentifier("dialog_LabelField", "id",
context.PackageName));
slider =
layout.FindViewById<SeekBar>(context.Resources.GetIdentifier("dialog_SliderField", "id",
context.PackageName));
left =
layout.FindViewById<ImageView>(context.Resources.GetIdentifier("dialog_ImageLeft", "id",
context.PackageName));
right =
layout.FindViewById<ImageView>(context.Resources.GetIdentifier("dialog_ImageRight", "id",
context.PackageName));
}
示例15: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.Main);
Button prevButton = FindViewById<Button> (Resource.Id.prevButton);
Button nextButton = FindViewById<Button> (Resource.Id.nextButton);
Button listenButton = FindViewById<Button> (Resource.Id.listenButton);
phraseTextView = FindViewById<TextView> (Resource.Id.phraseTextView);
translationTextView = FindViewById<TextView> (Resource.Id.translationTextView);
SoundPlayer soundPlayer = new SoundPlayerIml (Assets);
db = new InMemoryDatabase ();
new PopulateInMemoryDatabaseWithSampleDataCmd (db as InMemoryDatabase)
.Execute ();
presenter = new PhrasesPresenterIml (this, soundPlayer, db, lessonNumber);
prevButton.Click += delegate {
presenter.MovePrevious ();
};
nextButton.Click += delegate {
presenter.MoveNext ();
};
listenButton.Click += delegate {
presenter.PlaySoundStart ();
};
}