scrollviewer滚动到文本框位置

时间:2012-08-26 07:26:48

标签: c# windows-phone-7 xaml scrollview silverlight-toolkit

如何在Windows Phone中获取表单行为,如Settings >> Mobile Network >> EditAPN。 在此页面中,它在scrollviewer中有许多文本框。当用户点击任何文本框并获得焦点时,页面向上滚动并且页眉保持不变并显示SIP键盘。当用户从此文本框中丢失焦点时,页面将进入正常状态,SIP键盘隐藏和标题保持不变。我想实现这种行为。我在scrollviewer中放置了一些文本框,每个文本框都有焦点事件,我正在这样做。

this.Scroller.ScrollToVerticalOffset(this.txtbox1.ActualHeight); 
this.Scroller.UpdateLayout();

但它不适合我。任何帮助将是赞赏

1 个答案:

答案 0 :(得分:0)

一种方法是重置默认行为,以便在使用代码显示SIP时向上移动页面:

(App.Current as App).RootFrame.RenderTransform = new CompositeTransform();

on TextBox_Focus事件。比折叠标题和手动滚动你需要的。