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


C# View.SetOnClickListener方法代码示例

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


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

示例1: ItemViewHolder

 public ItemViewHolder(View view, Activity context) : base(view)
 {
     _itemView = view;
     view.Tag = this;
     _context = context;
     FavoriteName = _itemView.FindViewById<TextView>(Resource.Id.FavoriteItemName);
     FavoriteAdresse = _itemView.FindViewById<TextView>(Resource.Id.FavoriteItemAddress);
     _itemView.SetOnClickListener(new ItemClickListener(_context));
 }
开发者ID:ThePublicBikeGang,项目名称:EasyBike,代码行数:9,代码来源:FavoriteListAdapter.cs

示例2: SetCustomClickableViewAndItem

 public void SetCustomClickableViewAndItem(int clickableViewId)
 {
     _clickableView = ItemView.FindViewById(clickableViewId);
     ItemView.SetOnClickListener(this);
     _clickableView.SetOnClickListener(this);
     if (_rotationEnabled)
     {
         _clickableView.Rotation = _rotation;
     }
 }
开发者ID:frankcalise,项目名称:XamDroid.ExpandableRecyclerView,代码行数:10,代码来源:ParentViewHolder.cs

示例3: Crouton

        public Crouton(Activity activity, View customView, int durationInMs, Action<bool> onClick = null, object dataContext = null)
        {
            if (activity == null) throw new ArgumentNullException("activity");
            if (customView == null) throw new ArgumentNullException("customView");

            _activity = activity;
            _customView = customView;
            _onClick = onClick;
            customView.SetOnClickListener(this);
            DurationInMilliseconds = durationInMs;
            DataContext = dataContext;
        }
开发者ID:NimaGhaedsharafi,项目名称:ToastsRTL.Forms.Plugin,代码行数:12,代码来源:Crouton.cs

示例4: CreateView

        /**
         * 创建基本的背景视图
         */
        private View CreateView()
        {
            FrameLayout parent = new FrameLayout(_mContext);
            FrameLayout.LayoutParams parentParams =
                new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)
                {
                    Gravity = GravityFlags.Bottom
                };
            parent.LayoutParameters = parentParams;
            _mBg = new View(_mContext)
            {
                LayoutParameters =
                    new ActionBar.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)
            };
            _mBg.SetBackgroundColor(Color.Argb(136, 0, 0, 0));
            _mBg.Id = BgViewId;
            _mBg.SetOnClickListener(this);

            _mPanel = new LinearLayout(_mContext);
            FrameLayout.LayoutParams mPanelParams = new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)
            {
                Gravity = GravityFlags.Bottom
            };
            _mPanel.LayoutParameters = mPanelParams;
            //mPanel.setOrientation(LinearLayout.VERTICAL);
            //mPanel.Orientation = Linear
            parent.AddView(_mBg);
            parent.AddView(_mPanel);
            return parent;
        }
开发者ID:MicahelWang,项目名称:XamarinSamples,代码行数:34,代码来源:ActionSheet.cs

示例5: MakeText

        private static AppMsg MakeText(Activity context, String text, Style style, View view, bool floating, float textSize, View.IOnClickListener clickListener)
        {
            AppMsg result = new AppMsg(context);

            view.SetBackgroundResource(style.Background);
            view.Clickable = true;

            TextView tv = view.FindViewById<TextView>(Android.Resource.Id.Message);
            if (textSize > 0)
            {
                tv.SetTextSize(Android.Util.ComplexUnitType.Sp, textSize);
            }
            tv.Text = text;

            result.mView = view;
            result.mDuration = style.Duration;
            result.mFloating = floating;

            view.SetOnClickListener(clickListener);
            return result;
        }
开发者ID:huguodong,项目名称:AppMsg-For-Xamarin,代码行数:21,代码来源:AppMsg.cs

示例6: OnCreate

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

			//Set the window fullscreen so that the background is drawn the correct size
			Window.AddFlags(WindowManagerFlags.KeepScreenOn);
			Window.AddFlags (WindowManagerFlags.Fullscreen);
			Window.AddFlags (WindowManagerFlags.LayoutNoLimits);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.activity_fullscreen);

			controlsView = FindViewById (Resource.Id.fullscreen_content_controls);
			contentView = FindViewById (Resource.Id.fullscreen_content);

			controller_view = (ControllerView)FindViewById (Resource.Id.controller);

			for (int i = 0; i < buttons.Length; i++) 
				buttons [i] = 0;
			for (int i = 0; i < axes.Length; i++) 
				axes [i] = 0.0f;

			controller_view.SetButtonAxes (buttons, axes);

			//Set up a UI hider to control the UI visibility for the activity
			system_ui_hider = SystemUiHider.GetInstance (this, contentView, HIDER_FLAGS);
			system_ui_hider.Setup ();
			system_ui_hider.SetOnVisibilityChangeListener (new MyOnVisibilityChangeListener (this));

			contentView.SetOnClickListener (new MyOnClickListener (this));
			input_manager = (InputManager)GetSystemService (Context.InputService);
			CheckGameControllers ();

		}
开发者ID:assanee,项目名称:monodroid-samples,代码行数:34,代码来源:FullScreenActivity.cs

示例7: addItem

 public void addItem(View item, IOnClickListener listener)
 {
     mArcLayout.AddView(item);
     item.SetOnClickListener(getItemClickListener(listener));
 }
开发者ID:veresbogdan,项目名称:MMD,代码行数:5,代码来源:ArcMenu.cs

示例8: CreateView

        private View CreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            FrameLayout parent = new FrameLayout(Activity);
            parent.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent,
                ViewGroup.LayoutParams.MatchParent);
            mBg = new View(Activity);
            mBg.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent,
                ViewGroup.LayoutParams.MatchParent);
            mBg.SetBackgroundColor(Color.Argb(160, 0, 0, 0));
            mBg.SetOnClickListener(this);

            mPanel = new LinearLayout(Activity);
            FrameLayout.LayoutParams param = new FrameLayout.LayoutParams(
                FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.WrapContent);
            param.Gravity = GravityFlags.Bottom;
            mPanel.LayoutParameters = param;
            mPanel.Orientation = Android.Widget.Orientation.Vertical;
            View child = OnCreateChildView(inflater, container, savedInstanceState);

            parent.AddView(mBg);
            parent.AddView(mPanel);
            mPanel.AddView(child);
            return parent;
        }
开发者ID:huguodong,项目名称:ActionSheetCSharp,代码行数:24,代码来源:ActionSheet.cs

示例9: AddView

 public override void AddView(View child, int index, LayoutParams @params)
 {
     child.SetOnClickListener(this);
     base.AddView(child, index, @params);
 }
开发者ID:jonasmayor,项目名称:MonoDroid.TimesSquare,代码行数:5,代码来源:CalendarRowView.cs

示例10: MyView

 public MyView(View view)
     : base(view)
 {
     view.SetOnClickListener(this);
 }
开发者ID:dbeattie71,项目名称:FastScroll,代码行数:5,代码来源:LargeAdapter.cs

示例11: OnFinishInflate

		protected override void OnFinishInflate ()
		{
			mHandle = FindViewById( mHandleId );
			if ( mHandle == null ) { 
				throw new Java.Lang.IllegalArgumentException( "The handle attribute is must refer to an" + " existing child." ); 
			}
			mHandle.SetOnClickListener ((IOnClickListener)new DrawerToggler (this));

//			mHandle.Click += (sender, e) => {
//				if ( mLocked ) { return; }
//	
//					if ( mAnimateOnClick ) {
//						animateToggle();
//					} else {
//						toggle();
//					}
//			};
			  

			mContent = FindViewById( mContentId );
			if ( mContent == null ) { throw new Java.Lang.IllegalArgumentException( "The content attribute is must refer to an"
				+ " existing child." ); }
			mContent.Visibility = ViewStates.Gone ;

		}
开发者ID:jeedey93,项目名称:xamarin-android-samples,代码行数:25,代码来源:MultiDirectionSlidingDrawer.cs


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