我正在努力设计一个UI,它有三个不同的分组:
3
订阅和所有的联系人将是大名单。我在这方面的第一次发言如下:
<Expander>
<Expander.Header>
<Label
FontAttributes="Bold"
FontSize="Medium"
Text="Top 3" />
</Expander.Header>
<Expander.Content>
<CollectionView ItemsSource="{Binding MyContacts}">
<CollectionView.ItemTemplate>
<DataTemplate>
<StackLayout>
<SwipeView>
<SwipeView.LeftItems>
<SwipeItem BackgroundColor="Aquamarine" Text="Un Favorite" />
</SwipeView.LeftItems>
<SwipeView.Content>
<Label Text="{Binding DisplayName}" />
</SwipeView.Content>
</SwipeView>
</StackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Expander.Content>
</Expander>
<Expander>
<Expander.Header>
<Label
FontAttributes="Bold"
FontSize="Medium"
Text="Friends" />
</Expander.Header>
<Expander.Content>
<CollectionView ItemsSource="{Binding UppContacts}">
<CollectionView.ItemTemplate>
<DataTemplate>
<StackLayout>
<SwipeView>
<SwipeView.LeftItems>
<SwipeItem BackgroundColor="Brown" Text="Fav" />
</SwipeView.LeftItems>
<SwipeView.Content>
<Label Text="{Binding DisplayName}" />
</SwipeView.Content>
</SwipeView>
</StackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Expander.Content>
</Expander>但我似乎不能在一页中放一个以上的扩展器。当我一次只做一次的时候
发布于 2020-12-18 14:34:10
当您说页面上不能有多个扩展程序时,是否意味着您收到了一条错误消息,表示“属性”内容“已多次设置”之类的内容?
如果是这样的话,那么您可以简单地解决这个问题,方法是将所有的展开器包装在一个容器中。
例如:
<StackLayout>
<Expander>
<Expander.Header>
<Label
FontAttributes="Bold"
FontSize="Medium"
Text="Top 3" />
</Expander.Header>
<Expander.Content>
<CollectionView ItemsSource="{Binding MyContacts}">
<CollectionView.ItemTemplate>
<DataTemplate>
<StackLayout>
<SwipeView>
<SwipeView.LeftItems>
<SwipeItem BackgroundColor="Aquamarine" Text="Unfavorite" />
</SwipeView.LeftItems>
<SwipeView.Content>
<Label Text="{Binding DisplayName}" />
</SwipeView.Content>
</SwipeView>
</StackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Expander.Content>
</Expander>
<Expander>
<Expander.Header>
<Label
FontAttributes="Bold"
FontSize="Medium"
Text="Friends" />
</Expander.Header>
<Expander.Content>
<CollectionView ItemsSource="{Binding UppContacts}">
<CollectionView.ItemTemplate>
<DataTemplate>
<StackLayout>
<SwipeView>
<SwipeView.LeftItems>
<SwipeItem BackgroundColor="Brown" Text="Fav" />
</SwipeView.LeftItems>
<SwipeView.Content>
<Label Text="{Binding DisplayName}" />
</SwipeView.Content>
</SwipeView>
</StackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Expander.Content>
</Expander>
</StackLayout>https://stackoverflow.com/questions/65315965
复制相似问题