【发布时间】:2017-04-12 19:05:36
【问题描述】:
我像下面的代码一样设置它,但它不起作用。
ProductList.Margin = 10 //Exception
【问题讨论】:
标签: c# xamarin xamarin-zebble zebble
我像下面的代码一样设置它,但它不起作用。
ProductList.Margin = 10 //Exception
【问题讨论】:
标签: c# xamarin xamarin-zebble zebble
如果ProductList 是View,您可以像这样更改其填充和边距:
ProductList.Css.Padding = 10;
ProductList.Css.Margin = 20;
【讨论】:
或者,您可以使用提供流畅 API(因为它们返回对象)的扩展方法,如下所示:
ProductList.Padding(10).Margin(20);
这些扩展方法也允许您设置特定的边。例如:
ProductList.Padding(top: 10, right: 15)
.Margin(vertical: 20); // <-- this sets both top and bottom
【讨论】: