我尝试在两个StackLayouts之间放置ScrollView
StackLayout
但是当我滚动ScrollView
内的元素时,这些项始终与上级StackLayout
重叠在图像中:
ScreenShot http://image.prntscr.com/image/94ee77b1ccd9492bb416976cf2d8202a.png
我使用的代码是:
stackPrinc = new StackLayout()
{
Spacing = 0,
HorizontalOptions = LayoutOptions.FillAndExpand,
Children = {
ly_sup,
new ScrollView() { Content = ly_main, IsClippedToBounds = true, BackgroundColor = Color.Olive },
ly_inf },
};
答案 0 :(得分:3)
我解决了它,当一个元素在他上面和下面有一个元素时,它就会发生一个bug。我的新代码是;
stackPrinc = new StackLayout()
{
Spacing = 0,
Children = {
ly_sup,
new StackLayout() { Children = { new ScrollView() { Content = ly_main, IsClippedToBounds = true, BackgroundColor = Color.Aqua, } } },
ly_inf,
},
};