本文整理匯總了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++;
}
}