Layout 表单仅滚动页面的一部分

Layout 表单仅滚动页面的一部分,layout,xamarin,scrollview,Layout,Xamarin,Scrollview,我有一个页面,我想在顶部有一个始终可见的标题,在底部有一个始终可见的按钮。中间的内容是可滚动的。< /P> 我认为,通过以下操作,这将很容易: StackLayout outer = new StackLayout(); StackLayout inner = new StackLayout();//with all of the content added ScrollView scroll = new ScrollView(); outer.Children.Add(headerLa

我有一个页面,我想在顶部有一个始终可见的标题,在底部有一个始终可见的按钮。中间的内容是可滚动的。< /P> 我认为,通过以下操作,这将很容易:

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;


inner.Children.Add(inner);《盗梦空间》:)使用Android API版本23编译时出现此问题,将compile和Target恢复为22,并将其修复。因此,可能是由于目标所在的API版本,或者目标和值不相同@在我发现问题之前,MihaMarkic fix只是暂时的。回答得很好!很好用。嗨,我有点类似的问题?你能看看这里吗
scroll.IsClippedToBounds=true;