我想在水平方向使用扩展 Entry
和 a :Button
StackLayout
var item = new StackLayout {
Orientation = StackOrientation.Horizontal,
HorizontalOptions = LayoutOptions.FillAndExpand,
Children = {
new Entry {
Placeholder = "Feldtitel",
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.StartAndExpand // NOTE THIS
},
new Button{
Text = CFieldDescription.getNameForFieldType( fieldType ),
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.End
}
}};
虽然Entry
is 在开头,Button
is 在结尾,但 Xamarin.Forms 不会更改 的大小Entry
以填充水平空间:
我需要更改我的代码吗?还是我发现了一个错误?