• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Widget.TextView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



TextView类属于Android.Widget命名空间,在下文中一共展示了TextView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
		}
开发者ID:BananaScheriff,项目名称:legoev3,代码行数:33,代码来源:Activity1.cs


示例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);
        }
开发者ID:gruan01,项目名称:Xamarin-Example,代码行数:26,代码来源:SearchActivity.cs


示例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;
		}
开发者ID:tienbui123,项目名称:Mobile-VS2,代码行数:30,代码来源:LichHocHKFragment.cs


示例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);
        }
开发者ID:Cheesebaron,项目名称:MonoDroid.HorizontalPager,代码行数:28,代码来源:HorizontalPagerDemo.cs


示例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);
		}
开发者ID:jcapuano328,项目名称:LB.mono,代码行数:27,代码来源:GeneralActivity.cs


示例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))); // ズームレベル、方位、傾き
            }
        }
开发者ID:zcccust,项目名称:Study,代码行数:28,代码来源:MainActivity.cs


示例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);
            };
        }
开发者ID:slluis,项目名称:TrackMe,代码行数:29,代码来源:ShareLocationActivity.cs


示例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);


		}
开发者ID:Milton761,项目名称:MLRepo,代码行数:35,代码来源:CustomerImageView.cs


示例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;

            
        }
开发者ID:KimCM,项目名称:ReactiveUI,代码行数:32,代码来源:LinkerOverrides.cs


示例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 ();

		}
开发者ID:aragorn55,项目名称:ClassSampleCode,代码行数:25,代码来源:DateTimePickerActivity.cs


示例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();
            }
        }
开发者ID:ChallengeEarth,项目名称:beacon-prototype,代码行数:26,代码来源:MainActivity.cs


示例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);
 }
开发者ID:pdg6868,项目名称:SteveClient,代码行数:7,代码来源:ConnectionActivity.cs


示例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);
 }
开发者ID:huguodong,项目名称:TimeLine,代码行数:7,代码来源:TimeLineViewHolder.cs


示例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));
        }
开发者ID:talisqualis,项目名称:MvvmCross-Build,代码行数:25,代码来源:DroidResources.cs


示例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 ();
            };
        }
开发者ID:papagenoo,项目名称:BabylonMono,代码行数:34,代码来源:MainActivity.cs


示例16: OnCreate

        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);
            Title = "C# Client Library Tests";

            RequestWindowFeature (WindowFeatures.Progress);

            SetContentView (Resource.Layout.Harness);

            this.runStatus = FindViewById<TextView> (Resource.Id.RunStatus);

            this.list = FindViewById<ExpandableListView> (Resource.Id.List);
            this.list.SetAdapter (new TestListAdapter (this, App.Listener));
            this.list.ChildClick += (sender, e) => {
                Intent testIntent = new Intent (this, typeof(TestActivity));

                GroupDescription groupDesc = (GroupDescription)this.list.GetItemAtPosition (e.GroupPosition);
                TestDescription desc = groupDesc.Tests.ElementAt (e.ChildPosition);

                testIntent.PutExtra ("name", desc.Test.Name);
                testIntent.PutExtra ("desc", desc.Test.Description);
                testIntent.PutExtra ("log", desc.Log);

                StartActivity (testIntent);
            };

            SetProgressBarVisibility (true);
        }
开发者ID:RecursosOnline,项目名称:azure-mobile-services,代码行数:28,代码来源:HarnessActivity.cs


示例17: GetView

		public override View GetView(Context context, View convertView, ViewGroup parent)
        {
			var view = convertView as RelativeLayout;
			
			if (view == null)
				view = new RelativeLayout(context);
						
            var parms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                        ViewGroup.LayoutParams.WrapContent);
            parms.SetMargins(5, 3, 5, 0);
            parms.AddRule((int) LayoutRules.AlignParentLeft);

            _caption = new TextView(context) {Text = Caption, TextSize = 16f};
            view.AddView(_caption, parms);

            if (!string.IsNullOrEmpty(Value))
            {
                var tparms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                             ViewGroup.LayoutParams.WrapContent);
                tparms.SetMargins(5, 3, 5, 0);
                tparms.AddRule((int) LayoutRules.AlignParentRight);

                _text = new TextView(context) {Text = Value, TextSize = 16f};
                view.AddView(_text, tparms);
            }

            return view;
        }
开发者ID:xlvisuals,项目名称:MonoDroid.Dialog,代码行数:28,代码来源:StringElement.cs


示例18: FileListRowViewHolder

		public FileListRowViewHolder(TextView timeTextView, TextView textView, ImageView imageView, FloatingActionButton fab)
		{
			TimeTextView = timeTextView;
			TextView = textView;
			ImageView = imageView;
			Fab = fab;
		}
开发者ID:mcm811,项目名称:Hi5Controller.CSharp,代码行数:7,代码来源:FileListRowViewHolder.cs


示例19: OnCreate

        protected override void OnCreate(Bundle savedInstance) 
        {
            base.OnCreate(savedInstance);
			var tv = new TextView(this);
			tv.Text = ("Hello Dot42");
			SetContentView(tv);
        }
开发者ID:Xtremrules,项目名称:dot42,代码行数:7,代码来源:Simple.cs


示例20: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            ScrollView scrollView = new ScrollView(this);

            TableLayout tableLayout = new TableLayout(this);
            TableRow tablerow = new TableRow(this);

            // make columns span the whole width
            tableLayout.SetColumnStretchable(0, true);
            tableLayout.SetColumnStretchable(1, true);

            TextView DepartCollumn = new TextView(this);
            DepartCollumn.Text = "Depart";
            tablerow.AddView(DepartCollumn);
            TimetableList.TimeColumns.Add(DepartCollumn);
            TextView ArriveCollumn = new TextView(this);
            ArriveCollumn.Text = "Arrive";
            tablerow.AddView(ArriveCollumn);
            TimetableList.TimeColumns.Add(ArriveCollumn);

            tableLayout.AddView(tablerow);
            //			tableLayout.SetScrollContainer(true);

            scrollView.AddView(tableLayout);

            SetContentView(scrollView);
        }
开发者ID:MWGNZ,项目名称:Wellington-Trains,代码行数:29,代码来源:TimetableDayActivity.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DOM.Node类代码示例发布时间:2022-05-24
下一篇:
C# Widget.SeekBar类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap