本文整理汇总了C#中Xamarin.Forms.ScrollView.LayoutTo方法的典型用法代码示例。如果您正苦于以下问题:C# ScrollView.LayoutTo方法的具体用法?C# ScrollView.LayoutTo怎么用?C# ScrollView.LayoutTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xamarin.Forms.ScrollView
的用法示例。
在下文中一共展示了ScrollView.LayoutTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupStepView
public static void SetupStepView(RelativeLayout rLayout, ScrollView helpSv, StackLayout questionContainer, Command questionTappedCmd)
{
var tgr = new TapGestureRecognizer()
{
Command = new Command((obj) =>
{
var oldBound = helpSv.Bounds;
if (oldBound.Height == 40)
{
// Need to show.
var newBound = new Rectangle(0, rLayout.Height - 200, rLayout.Width, 200);
helpSv.LayoutTo(newBound, 250, Easing.CubicInOut);
}
else
{
// Need to hide.
var newBound = new Rectangle(0, rLayout.Height - 40, rLayout.Width, 40);
helpSv.LayoutTo(newBound, 250, Easing.CubicInOut);
}
})
};
helpSv.GestureRecognizers.Add(tgr);
var qControls = questionContainer.Children.Where(x => x is QuestionLayout).Cast<QuestionLayout>();
var currIdx = 0;
foreach (var qControl in qControls)
{
var questionTgr = new TapGestureRecognizer()
{
Command = questionTappedCmd,
CommandParameter = currIdx,
};
qControl.GestureRecognizers.Add(questionTgr);
currIdx++;
}
}