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


C# TextView.SetOnClickListener方法代码示例

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


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

示例1: InitTextView

		private void InitTextView( ) {
			tvTabmyAlarm = View.FindViewById<Button>(Resource.Id.tv_tab_myAlarm);
			tvTabotherAlarm = View.FindViewById<Button>(Resource.Id.tv_tab_otherAlarm);
			tvTabmyAlarm.SetTextColor(Resources.GetColor(Resource.Color.blue));

			tvTabmyAlarm.SetOnClickListener(this);
			tvTabotherAlarm.SetOnClickListener(this);
		}
开发者ID:lq-ever,项目名称:EldYoungAndroidApp,代码行数:8,代码来源:AlarmInfoFragment.cs

示例2: Content

			public Content (Context context, IAttributeSet attrs) : base (context, attrs)
			{
				mNavHider = () => SetNavVisibility (false);
				mText = new TextView (context);
				mText.SetTextSize (ComplexUnitType.Dip, 16);
				mText.Text = context.GetString (Resource.String.alert_dialog_two_buttons2ultra_msg);
				mText.Clickable = false;
				mText.SetOnClickListener (this);
				mText.SetTextIsSelectable (true);
				AddView (mText, new ViewGroup.LayoutParams (
					ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));

				SetOnSystemUiVisibilityChangeListener (this);
			}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:14,代码来源:ContentBrowserActivity.cs

示例3: OnCreate

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

            //Thread.Sleep(10000); // Simulate a long loading process on app startup.
            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.activity_register_main);

            /*Setting flat name in Spinner control */
            Spinner spinner = FindViewById<Spinner> (Resource.Id.flatspinner);
            spinner.ItemSelected += new EventHandler<AdapterView.ItemSelectedEventArgs> (spinner_ItemSelected);
            var adapter = ArrayAdapter.CreateFromResource (
                this, Resource.Array.Flats_array, Android.Resource.Layout.SimpleSpinnerItem);

            adapter.SetDropDownViewResource (Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinner.Adapter = adapter;
            /*end*/

            /*create or open database*/
            myDb = new my_SqliteDatabaseHelper(this);
            /*end create or open database*/

            errorIcon = Resources.GetDrawable(Resource.Drawable.correcticon);
            correctIcon = Resources.GetDrawable(Resource.Drawable.erroricon);

            imageview_profile= FindViewById<ImageView> (Resource.Id.imageview_profile);

            etname = FindViewById<EditText> (Resource.Id.etname);
            etAge = FindViewById<EditText>(Resource.Id.etAge);
            etUsername  = FindViewById<EditText>(Resource.Id.etUsername);

            //etFlatNo  = FindViewById<EditText>(Resource.Id.etFlatNo);
            etpwd  = FindViewById<EditText>(Resource.Id.etpwd);
            etEmail  = FindViewById<EditText>(Resource.Id.etEmail);

            etEmail.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) =>
            {
                if (IsValidEmail(e.Text.ToString()))
                {
                    //change icon to green
                    etEmail.SetError("right", errorIcon);
                    //emailEditText.SetError(
                }
                else
                {
                    //emailEditText.set
                    etEmail.SetError("wrong", correctIcon);
                    //change icon to red
                }
            };

            bSignUp= FindViewById <Button>(Resource.Id.bSignUp);
            tvLoginLink = FindViewById<TextView> (Resource.Id.tvLoginLink);

            bSignUp.SetOnClickListener(this);
            tvLoginLink.SetOnClickListener (this);
            imageview_profile.SetOnClickListener (this);
            //bLogout.Click += DoClick ();
            //btSave.Click +=  DoClick ();
        }
开发者ID:ngoswami1978,项目名称:Login-and-Registration-in-Xamarin,代码行数:60,代码来源:MainActivity.cs

示例4: SetupViews

        private void SetupViews()
        {
            quantity = FindViewById<EditText>(Resource.Id.quantity);
            productName = FindViewById<TextView>(Resource.Id.product_name);
            productName.SetOnClickListener(this);

            returnable = FindViewById<TextView>(Resource.Id.returnable);
            returnable.SetOnClickListener(this);

            returnablePrice = FindViewById<TextView>(Resource.Id.returnable_price);

            var backspace = FindViewById<ImageButton>(Resource.Id.quantity_backspace);
            backspace.SetOnClickListener(this);

            highlightText = Resources.GetColor(Resource.Color.colorPrimary);
            standardText = Resources.GetColor(Resource.Color.primaryText);

            AddListenterToButtons(this);
        }
开发者ID:asanyaga,项目名称:BuildTest,代码行数:19,代码来源:AddProductItemView.cs

示例5: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.activity_Login);
            try
            {
                blnchkRemember=true;
                isLogin=false;
                var remeberCredentials = settingservice.GetSetting<bool>("RemeberCredentials");
                blnchkRemember=remeberCredentials ;

                hideControls(true);

                /*create or open database*/
                myDb = new my_SqliteDatabaseHelper(this);
                /*end create or open database*/

                errorIcon = Resources.GetDrawable(Resource.Drawable.correcticon);
                correctIcon = Resources.GetDrawable(Resource.Drawable.erroricon);

                // Create your application here
                bSignIn=FindViewById<Button>(Resource.Id.bSignIn);
                tvregister = FindViewById<TextView> (Resource.Id.tvregister);
                tvforget = FindViewById<TextView> (Resource.Id.tvforget);
                etUsername=FindViewById<EditText>(Resource.Id.etUsername);
                etpwd=FindViewById<EditText>(Resource.Id.etpwd);

                if (remeberCredentials==true)
                {
                    var savedusername = settingservice.GetSetting<string>("username");
                    var savedpassword = settingservice.GetSetting<string>("password");
                    if (savedusername != null)
                    {
                        etUsername.Text=savedusername.ToString();
                        etpwd.Text=savedpassword.ToString();
                    }
                }

                CheckBox checkbox = FindViewById<CheckBox>(Resource.Id.checkbox_remember_me);
                checkbox.Checked=blnchkRemember;

                //Gets TextView object instances
                shMsg = FindViewById<TextView> (Resource.Id.shMsg);

                //Gets ListView object instance
                listItems = FindViewById<ListView> (Resource.Id.listItems);

                //Add ItemClick event handler to ListView instance
                listItems.ItemClick += new EventHandler<AdapterView.ItemClickEventArgs> (item_Clicked);

                //Sets Database class message property to shMsg TextView instance
                shMsg.Text = myDb.sqldb_message;

                bSignIn.SetOnClickListener (this);
                tvregister.SetOnClickListener (this);
                tvforget.SetOnClickListener (this);

                checkbox.Click += (o, e) => {
                    if (checkbox.Checked)
                        //Toast.MakeText (this, "Selected", ToastLength.Short).Show ();
                        blnchkRemember=true;
                    else
                        //Toast.MakeText (this, "Not selected", ToastLength.Short).Show ();
                        blnchkRemember=false;
                };

            }
            catch (Exception ex) {
                var toast = Toast.MakeText (this, ex.Message ,ToastLength.Short);
                toast.Show ();
            }
        }
开发者ID:ngoswami1978,项目名称:Login-and-Registration-in-Xamarin,代码行数:72,代码来源:LoginScreen.cs

示例6: InitDropDown

 public void InitDropDown(ListItem l)
 {
     int j = 0;
     Initials = new List<TextView> ();
     foreach (BonLijst.Participant dude in l.Deelnemers) {
         string[] subnames = dude.name.Split (' ');
         string initials;
         if (subnames.Length == 1) {
             if (subnames [0].Length == 1) {
                 initials = subnames [0] [0].ToString () + ".";
             } else {
                 initials = subnames [0] [0].ToString () + subnames [0] [1].ToString () + ".";
             }
         } else {
             initials = subnames [0] [0].ToString () + "." + subnames [1] [0].ToString () + ".";
         }
         TextView initialTextView = new TextView (Application.Context);
         initialTextView.Text = initials;
         initialTextView.SetTextColor (Android.Graphics.Color.Black);
         initialTextView.TextSize = 30;
         initialTextView.SetPadding(16, 16, 16, 16);
         //initialTextView.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams);
         initialTextView.SetOnClickListener(this);
         Initials.Add (initialTextView);
         DropDown.AddView(initialTextView);
         j++;
     }
 }
开发者ID:SansSkill,项目名称:Introproject,代码行数:28,代码来源:ListItemAdapter.cs

示例7: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var rootView = inflater.Inflate(Resource.Layout.fragment, null);

            var containerMap = (FrameLayout) rootView.FindViewById(Resource.Id.container_map);
            var mapView = base.OnCreateView(inflater, container, savedInstanceState);
            containerMap.AddView(mapView,
                new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent));

            var map = Map;
            map.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(48.35, 31.16), 5.5f));
            map.UiSettings.RotateGesturesEnabled = false;
            map.SetOnMapClickListener(this);
            map.SetOnMarkerClickListener(this);

            map.Clear();
            _spots.Clear();
            var icon = BitmapDescriptorFactory.FromResource(Resource.Drawable.pin);
            foreach (var spot in SpotsArray)
            {
                var mo = new MarkerOptions();
                mo.SetPosition(spot.Position);
                mo.SetIcon(icon);
                mo.SetTitle(spot.Name);
                mo.SetSnippet("foo");
                var marker = map.AddMarker(mo);

                _spots.Add(marker.Id, new AnnotationModel(marker, spot));
            }

            _infoWindowContainer = rootView.FindViewById(Resource.Id.container_popup);

            // Subscribe to resize pop-up window
            _infoWindowLayoutListener = new InfoWindowLayoutListener();
            _infoWindowContainer.ViewTreeObserver.AddOnGlobalLayoutListener(_infoWindowLayoutListener);
            OverlayLayoutParams = (AbsoluteLayout.LayoutParams) _infoWindowContainer.LayoutParameters;

            textView = (TextView) _infoWindowContainer.FindViewById(Resource.Id.textview_title);
            _button = (Button) _infoWindowContainer.FindViewById(Resource.Id.foo);
            _button.SetOnClickListener(this);

            return rootView;
        }
开发者ID:ChaseFlorell,项目名称:info-window-demo,代码行数:43,代码来源:MyMapFragment.cs

示例8: SetGameTitle

        /// <summary>
        /// ������ϷTitle�Ͷ�Ӧʡ���б�
        /// </summary>
        public void SetGameTitle()
        {
            txtTitle.Text = Barrier.Title;
            List<Barrier> list = ShengDaoList.ToList();
            list.Sort(delegate(Barrier a, Barrier b) { return (new Random()).Next(-1, 1); });
            glShengList.RemoveAllViews();
            foreach (var item in list)
            {
                TextView textView = new TextView(this);

                GridLayout.LayoutParams m = new GridLayout.LayoutParams();
                m.Width = GridLayout.LayoutParams.WrapContent;
                m.Height = GridLayout.LayoutParams.WrapContent;
                if (Resources.DisplayMetrics.Density == 1)
                {
                    m.SetMargins(10, 10, 10, 10);
                    textView.SetTextSize(Android.Util.ComplexUnitType.Sp, 22);
                }
                else
                {
                    m.SetMargins(5, 5, 5, 5);
                }
                textView.LayoutParameters = m;
                textView.SetTextColor(Android.Graphics.Color.White);
                textView.SetBackgroundResource(Resource.Drawable.game_sheng);
                textView.Gravity = GravityFlags.Center;
                textView.Text = item.Name;
                textView.Id = item.Id;
                textView.SetOnClickListener(this);

                glShengList.AddView(textView);
            }
            switch (Barrier.Id)
            {
                case 0:
                    imgPeople.SetImageResource(Resource.Drawable.game_people_jian);
                    break;
                case 1:
                    imgPeople.SetImageResource(Resource.Drawable.game_people_ling);
                    break;
                case 2:
                    imgPeople.SetImageResource(Resource.Drawable.game_people_qian);
                    break;
                case 3:
                    imgPeople.SetImageResource(Resource.Drawable.game_people_yao);
                    break;
                case 4:
                    imgPeople.SetImageResource(Resource.Drawable.game_people_ye);
                    break;
            }
        }
开发者ID:i-1213,项目名称:Game,代码行数:54,代码来源:GameActivity.cs


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