触发Xamarin.Forms选择器 [英] Trigger Xamarin.Forms Picker

查看:181
本文介绍了触发Xamarin.Forms选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过编程方式触发选择器吗?

Can i Trigger a Picker programatically?

我希望选择器旁边有一个按钮,指示该选择器是可单击的下拉列表".但是,单击按钮后如何打开选择器?

I would like a button beside the picker that indicates that the picker is a clickable "dropdown". But how could I open the picker when the button is clicked?

推荐答案

您可以命名选择器(例如myPicker)并调用其Focus事件.确保在调用myPicker.Focus()时位于主线程上

You can name the picker (e.g. myPicker) and call its Focus event. Do make sure that you're on the main thread at the time you're calling myPicker.Focus()

这篇关于触发Xamarin.Forms选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆