我有一个被 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
提前致谢