Xamarin表单:Stacklayout GestureRecognizers在UWP中不起作用(在IOS和Android中正常工作)

时间:2018-05-28 05:23:04

标签: xamarin.forms gesture-recognition stacklayout

我有一个被stacklayout包围的条目,对于堆栈,我添加了如下的GestureRecognizers:

     <StackLayout>
            <Entry
                TextColor="Black"
                x:Name="phoneone"/>
                <StackLayout.GestureRecognizers>
                    <TapGestureRecognizer
                            Tapped="CallingPhone1"
                            NumberOfTapsRequired="1">
                    </TapGestureRecognizer>
                </StackLayout.GestureRecognizers> 
        </StackLayout>

我的CallingPhone1代码:

public async void CallingPhone1(object sender,EventArgs args)
     {
            Debug.WriteLine("Enter1");
            var answer = await DisplayAlert("Alert", "Do you want to call this number?", "Yes", "No");
            if (answer)
            {
                string firstphone = phoneone.Text;
                try
                {
                    PhoneDialer.Open(firstphone);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("Exception:>>" + ex);
                }
            }
        }

当我点击条目时,注意到UWP正在发生。但显示线程0x6adc已退出输出框中的代码0(0x0)。我正在使用 xamarin.forms 2.5.0.121934

提前致谢

0 个答案:

没有答案