c# - 如何在 Xamarin.Forms 中访问 TableView 的子级

标签 c# xamarin xamarin.forms

            var tv = new TableView
            {
                Intent = TableIntent.Form,
                Root = new TableRoot
            {
                new TableSection
                {
                    new SwitchCell
                    {
                        Text = "Remember Me"
                    }
                }
            }
            };

如何访问 SwitchCell 以便在 Xamarin Forms 中看到 On 属性

More info on SwitchCell found here

最佳答案

明白了:

SwitchCell sc = (SwitchCell)tv.Root[0][0];
bool booleanprop = sc.On;

只要你知道怎么做就很容易。

关于c# - 如何在 Xamarin.Forms 中访问 TableView 的子级,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25199662/

相关文章:

c# - 将数组转换为 IEnumerable<T>

c# - 使用 asp.net 从数据库中检索数据( 'user' 附近的语法不正确)

c# - 搜索日期范围内的票证字段

c# - 多个数据库上下文

Android xamarin visual studio 错误 : 'System.Configuration.dll'

c# - Xamarin Android 应用遇到未找到类 ... 在路径 : DexPathList[[zip file . ..]...]

c# - 即使应用程序关闭,Xamarin Forms 后台服务也可实现数据同步

ios - Xamarin Forms - 根据设备(即 iPhone/iPad)更改字体大小

xamarin.forms - 如何在 xamarin.forms 中获取状态栏高度?

wpf - 如何在 xamarin.froms 中为 WPF 中的图像添加鼠标事件的缩放功能