본문 바로가기
프로그래밍/Android

Xamrin Touch Event

by 즉흥 2016. 8. 24.
728x90
반응형
1
2
3
4
5
6
7
8
9
var button = FindViewById<ImageButton>(Resource.Id.MyImageButton);
 
button.Touch += (object sender, View.TouchEventArgs e) => {
    if (e.Event.Action == MotionEventActions.Down) {
        button.SetImageResource(Resource.Drawable.Icon);
    } else if (e.Event.Action == MotionEventActions.Up) {
        button.SetImageResource(Android.Resource.Drawable.IcMenuGallery);
    }
};
cs



출처 : http://stackoverflow.com/questions/12682586/change-image-while-imagebutton-is-pressed

728x90
반응형

댓글