我有此代码:
var layout = new StackLayout
{
Orientation = StackOrientation.Vertical,
Spacing = 0
};
layout.Children.Add(new HeaderTemplate
{
Header = Settings.cc.LongText().ToUpper()
});
这两个语句可以以某种方式组合吗?
答案 0 :(得分:2)
尝试一下。
var layout = new StackLayout
{
Orientation = StackOrientation.Vertical,
Spacing = 0,
Children =
{
new HeaderTemplate
{
Header = Settings.cc.LongText().ToUpper()
}
}
};