Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/109.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 获取表节上的条目数_C#_Ios_C# 4.0_Xamarin.forms_Tableviewcell - Fatal编程技术网

C# 获取表节上的条目数

C# 获取表节上的条目数,c#,ios,c#-4.0,xamarin.forms,tableviewcell,C#,Ios,C# 4.0,Xamarin.forms,Tableviewcell,如果我得到这个int 我可以设置桌子的正确高度 所以我试着: public class Test : ContentPage{ {...} tableTest = new TableView { Intent = TableIntent.Data, BackgroundColor = Colors.WhiteTranslucent,

如果我得到这个int 我可以设置桌子的正确高度

所以我试着:

public class Test : ContentPage{

    {...}

    tableTest = new TableView {
                        Intent = TableIntent.Data,
                        BackgroundColor = Colors.WhiteTranslucent,
                        RowHeight = 40,
                        Root = new TableRoot {
                            new TableSection () {
                                new TextCell { Text = "Contato 1",  TextColor = Color.Black, },
                                new TextCell { Text = "Contato 2", TextColor = Color.Black,  },
                            },
                        },
                    };


    layout.Children.Add (tableTest,
                        xConstraint: Constraint.RelativeToParent ((parent) => 0),
                        yConstraint: Constraint.RelativeToParent ((parent) => 150),
                        widthConstraint: Constraint.RelativeToParent ((parent) => parent.Width),
                        **heightConstraint: Constraint.RelativeToParent ((parent) => **(*GetEntryCell (0,0).* * contacts.RowHeight))**
                    );

    {...}

TableSection GetEntryCell (int row, int column)
{
return (TableSection)contacts.Root [row] [column];
}


 }
但是我没有电话号码

将来我会得到它,因为我会去BD。 因为我需要一个解决方案

我使用此选项访问表:

TableSection GetEntryCell (int row, int column);

也许我不理解这个问题,但是
tableTest.Root.Count
将为您提供TableView中的节数,
tableTest.Root[0]。Count
将为您提供节中的项目数