呈現照片(圖片)

圖片支援手勢操作

按二下(Tap)

參考範例:https://github.com/xamarin/xamarin-forms-samples/tree/master/WorkingWithGestures/PanGesture

<Grid Padding="5">
      <local:PanContainer>
        <Image x:Name="myeCard" Aspect="AspectFill">
          <Image.GestureRecognizers>
            <TapGestureRecognizer
                    Tapped="OnTapGestureRecognizerTapped"
                    NumberOfTapsRequired="2" />
          </Image.GestureRecognizers>
        </Image>
      </local:PanContainer>
</Grid>

第一次按二下放大;第二次按下二下復原

int tapCount = 0;
async void OnTapGestureRecognizerTapped(object sender, EventArgs e)
{
            tapCount++;

            if (tapCount % 2 == 0)
            {
                this.Scale -= 0.5;
            }
            else
            {
                this.Scale += 0.5;
            }
}

pinch (雙指操作)

https://developer.xamarin.com/guides/xamarin-forms/user-interface/gestures/pinch/

multi-touch (pinch + tap)

https://github.com/davidezordan/multi-touch

http://mylabtw.blogspot.tw/2016/09/xamarinforms-image.html

results matching ""

    No results matching ""