【发布时间】:2016-06-04 00:46:06
【问题描述】:
您好,我正在开发一个使用 xamarin 表单构建的移动应用程序,主页是一个列表视图,其中列出了类别。我需要发生的是,当用户单击列表视图中的项目时,它会在应用程序中打开新页面,这是 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="SchoolTools.HomePage">
<ListView HasUnevenRows="true">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Frame Padding="0,0,0,8" BackgroundColor="#d2d5d7">
<Frame.Content>
<Frame Padding="15,15,15,15" OutlineColor="Gray" BackgroundColor="White">
<Frame.Content>
<StackLayout Padding="20,0,0,0" Orientation="Horizontal" HorizontalOptions="CenterAndExpand">
<Label x:Name="Internet" Text="Internet" HorizontalOptions="Center">
</Label>
<Label x:Name ="Math" Text="Math" HorizontalOptions="Center">
</Label>
<Label x:Name="Science" Text="Science" HorizontalOptions="Center">
</Label>
<Label x:Name ="Handwriting" Text="Handwriting" HorizontalOptions="Center">
</Label>
<Label x:Name ="FlashCards" Text="FlashCards" HorizontalOptions="Center">
</Label>
<Label x:Name="Books" Text="Books" HorizontalOptions="Center">
</Label>
</StackLayout>
</Frame.Content>
</Frame>
</Frame.Content>
</Frame>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
所以我的问题是使数学文件带您进入 MathToolsHome 类的代码是什么?等等等等?
任何帮助都会很棒!
提前一百万谢谢! :)
【问题讨论】:
-
列表中的每一行都有 6 个标签?还是您只想要一个包含 6 行且每行一个标签的列表?
标签: c# xaml xamarin xamarin.android xamarin.forms