更新xamarin表单后,relativelayouts中的堆栈布局布局不正确
我的一些更新xamarin表单后,relativelayouts中的堆栈布局布局不正确,xamarin,xamarin.android,xamarin.forms,Xamarin,Xamarin.android,Xamarin.forms,我的一些stacklayout在将它们添加到RelativeLayout时,正在包装到它们的内容宽度/高度,而不是使用给定给它们的约束。我的导航栏就是一个例子。我是这样创造的 var leftButtonLayout = new StackLayout { Children = { _sceneMainToolsView.MenuButton, _sceneTitle }, Orientation = StackOrientation.Horizontal, BackgroundCo
stacklayout
在将它们添加到RelativeLayout
时,正在包装到它们的内容宽度/高度,而不是使用给定给它们的约束。我的导航栏就是一个例子。我是这样创造的
var leftButtonLayout = new StackLayout
{
Children = { _sceneMainToolsView.MenuButton, _sceneTitle },
Orientation = StackOrientation.Horizontal,
BackgroundColor = Color.FromHex(Colours.Orange),
HorizontalOptions = LayoutOptions.StartAndExpand,
Spacing = 8
};
我将其添加到我的相对布局中
_layout.Children.Add(leftButtonLayout,
Constraint.RelativeToParent(p => 0),
Constraint.RelativeToParent(p => 0),
Constraint.RelativeToParent(p => p.Width),
Constraint.RelativeToParent(p => NavBarHeight));
后来我设置了ContentView的Content
属性
Content = _layout;
自从我将我的xamarin forms nuget包更新到2.3.0.49(使用某些dll所必需的)之后,这种情况就一直发生。有人知道为什么会发生这种情况或者如何解决吗?我正在Android 4.4.2(kitkat)上进行测试,并使用6.0(棉花糖)进行编译。您所做的似乎是正确的。我试着在上面写一个bug。你所做的似乎是正确的。我会试着在上面写个bug。