【发布时间】:2020-05-27 19:12:15
【问题描述】:
我是移动应用开发的初学者,我正在为一个项目使用 Xamarin 表单开发一个 android 应用。
在我的 Xamarin 表单项目中,我必须在启动时添加启动画面。为此,我必须将此代码放在我的 MainPage.XAML
<Grid>
<!-- Place new controls here -->
<Label Text="Welcome to Xamarin.Forms!"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand" />
<Grid x:Name="SplashGrid" BackgroundColor="{StaticResource Primary}">
<Image x:Name="Logo" Source="Logo" HorizontalOptions="Center" VerticalOptions="Center">
<Image.TranslationY>
<OnPlatform x:TypeArguments="x:Double">
<On Platform="Android">-12</On>
</OnPlatform>
</Image.TranslationY>
</Image>
</Grid>
</Grid>
但我的主页是选项卡式页面,而不是内容页面。
在我的主页保持选项卡状态时,我可以做些什么来实现启动画面?
如果我的标签页可以在加载主页后自动打开,那也很好。
这就是我的 App.xaml.cs 的构造函数的外观。
public App()
{
InitializeComponent();
MainPage = new NavigationPage(new TabbedPageContainer());
}
非常感谢您的帮助。 提前致谢。
【问题讨论】:
标签: c# android xaml xamarin.forms