我有一個帶有4個StackLayouts的頁面,在OnAppearing上,我將底部的3個“向上滑動”,以便頂部下方的第2個頂部創建一個帶有工具欄的下拉效果,供用戶單擊(XAML中的iconStack),然后將堆棧向上或向下滑動。當我單擊它以使其上下滑動時,此方法工作正常,但是當我向上滑動OnAppearing時,有時它不能完全向上移動,從而使某些堆??梢?,并且我看不到原因,或在調試中看不到任何東西。誰能在我的代碼中發現明顯的東西?protected override async void OnAppearing() { // here I get some data from the database and set labels etc before I do the next line... SlideUp(0); base.OnAppearing(); }public void SlideUp(uint time) { TopLayout.TranslateTo(0, (headerStack.Bounds.Height - (TopLayout.Height + headerStack.Height)), time, Easing.Linear); headerStack.TranslateTo(0, (headerStack.Bounds.Height - (TopLayout.Height + headerStack.Height)), time, Easing.Linear); Articlestack.TranslateTo(0, (headerStack.Bounds.Height - (TopLayout.Height + headerStack.Height)), time, Easing.Linear); } public void SlideDown(uint time) { TopLayout.TranslateTo(0, 0, time, Easing.Linear); headerStack.TranslateTo(0, 0, time, Easing.Linear); Articlestack.TranslateTo(0, 0, time, Easing.Linear); }XAML:<?xml version="1.0" encoding="utf-8" ?><ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="gl_mobile_app.Views.Article.ArticleInfoOpen" xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared" xmlns:local="clr-namespace:gl_mobile_app.Views.Templates;assembly=gl_mobile_app" xmlns:ratio="clr-namespace:gl_mobile_app;assembly=gl_mobile_app" xmlns:custom="clr-namespace:gl_mobile_app.Controls;assembly=gl_mobile_app" xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"> <ContentPage.ToolbarItems> <ToolbarItem Text="Back" Clicked="GoBack" /> </ContentPage.ToolbarItems>
- 1 回答
- 0 關注
- 217 瀏覽
添加回答
舉報
0/150
提交
取消