gpt4 book ai didi

layout - xamarin.Forms 仅滚动页面的一部分

转载 作者:行者123 更新时间:2023-12-04 18:41:10 24 4
gpt4 key购买 nike

我有一个页面,我希望顶部始终显示标题,底部始终显示按钮。中间的内容是可滚动的。

我认为通过执行以下操作会很容易:

StackLayout outer = new StackLayout();

StackLayout inner = new StackLayout();//with all of the content added

ScrollView scroll = new ScrollView();


outer.Children.Add(headerLabel);//non-scrolling

scroll.Content = inner;

outer.Children.Add(scroll); //scrolling

outer.Children.Add(button); //non-scrolling

headerLabel 和按钮保持在正确的位置,但内容滚动到页面顶部,在 headerLabel 的顶部(但在底部按钮下方/下方)。

我很肯定它工作正常,但我不记得改变任何东西。

有没有人知道为什么会发生这种情况?

最佳答案

所以这修复了它

outer.VerticalOptions = LayoutOptions.End;


scroll.IsClippedToBounds=true;

关于layout - xamarin.Forms 仅滚动页面的一部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26202351/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com