本文整理汇总了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));
}
示例2: SetCustomClickableViewAndItem
public void SetCustomClickableViewAndItem(int clickableViewId)
{
_clickableView = ItemView.FindViewById(clickableViewId);
ItemView.SetOnClickListener(this);
_clickableView.SetOnClickListener(this);
if (_rotationEnabled)
{
_clickableView.Rotation = _rotation;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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 ();
}
示例7: addItem
public void addItem(View item, IOnClickListener listener)
{
mArcLayout.AddView(item);
item.SetOnClickListener(getItemClickListener(listener));
}
示例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;
}
示例9: AddView
public override void AddView(View child, int index, LayoutParams @params)
{
child.SetOnClickListener(this);
base.AddView(child, index, @params);
}
示例10: MyView
public MyView(View view)
: base(view)
{
view.SetOnClickListener(this);
}
示例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 ;
}