我不知道是什么導致 swipeview 專案中的文本被截斷。我只在Android上運行過這個。有什么想法嗎?我發誓它在幾個小時前還在作業......
我已經梳理了檔案,并且除了 Text="" 之外,swipeview 上沒有與文本相關的其他屬性

這是 XAML:
<ContentPage.Resources>
<Style TargetType="Label">
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="TextColor" Value="Black" />
</Style>
<Style TargetType="SwipeView">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="DarkSeaGreen" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#508350" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
</ContentPage.Resources>
<Page.Behaviors>
<mct:StatusBarBehavior
StatusBarColor="Beige"
StatusBarStyle="DarkContent" />
</Page.Behaviors>
<CollectionView ItemsSource="{Binding Transactions}"
SelectionMode="Single"
>
<CollectionView.EmptyView>
<StackLayout Padding="50">
<Label TextColor="White"
FontAttributes="Bold"
HorizontalOptions="CenterAndExpand"
Text="NO DATA"
VerticalOptions="CenterAndExpand" />
</StackLayout>
</CollectionView.EmptyView>
<CollectionView.ItemsLayout>
<LinearItemsLayout Orientation="Vertical" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="model:BudgetDisplay">
<SwipeView>
<SwipeView.LeftItems>
<SwipeItems Mode="Reveal">
<SwipeItem BackgroundColor="LightPink" Text="Delete" />
</SwipeItems>
</SwipeView.LeftItems>
<Grid Margin="5,3,5,3" Padding="0,5,0,0" ColumnDefinitions="10,*,*,*,*,100" RowDefinitions="*,*" BackgroundColor="#CFE2CF">
<Label Grid.ColumnSpan="6" Grid.Column="0" Grid.Row="0" Text="{Binding Date, StringFormat='{0:d}'}"/>
<Label Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1" Text="{Binding Payee}" HorizontalTextAlignment="Start"/>
<Label Grid.Column="3" Grid.Row="1" Text="{Binding Amount, StringFormat='{0:c}'}" HorizontalTextAlignment="End"/>
<Label Grid.Column="4" Grid.Row="1" Text="{Binding LineBalance, StringFormat='{0:c}'}" HorizontalTextAlignment="End"/>
<Label Grid.Column="5" Grid.Row="1" Text="{Binding Catagory}" HorizontalTextAlignment="Center"/>
</Grid>
</SwipeView>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
uj5u.com熱心網友回復:
確實,您需要將該HeightRequest屬性添加到下面的SwipeViewandGrid中。我測驗了它,它按預期作業。正如史蒂夫建議的那樣,這似乎是 Android 上的一個潛在問題,您可以通過此鏈接提出新問題。
<SwipeView HeightRequest="60">
<SwipeView.LeftItems>
<SwipeItems Mode="Reveal">
<SwipeItem BackgroundColor="LightPink" Text="Delete" />
</SwipeItems>
</SwipeView.LeftItems>
<VerticalStackLayout>
<Grid HeightRequest="60" Margin="5,3,5,3" Padding="0,5,0,0" ColumnDefinitions="10,*,*,*,*,100" RowDefinitions="*,*" BackgroundColor="#CFE2CF">
</Grid>
</VerticalStackLayout>
</SwipeView>
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/519341.html
上一篇:顫振布爾是正確的,但不改變物理?
