C# 我的swipeview不会首先以编程方式打开
我的项目是Xamarin形式的,我有一个非常简单的代码C# 我的swipeview不会首先以编程方式打开,c#,xaml,xamarin,xamarin.forms,C#,Xaml,Xamarin,Xamarin.forms,我的项目是Xamarin形式的,我有一个非常简单的代码 <SwipeView x:Name="MainSwipe" BackgroundColor="#dcdde1"> <SwipeView.LeftItems> <SwipeItems Mode="Reveal">
<SwipeView x:Name="MainSwipe" BackgroundColor="#dcdde1">
<SwipeView.LeftItems>
<SwipeItems Mode="Reveal">
<SwipeItemView>
<StackLayout BackgroundColor="#208b55" Orientation="Vertical" Margin="20">
<Label Text="HITÉLET" Style="{x:StaticResource LabelLeftMenu}" x:Name="open_hitelet" Padding="10"/>
<Label Text="KULTÚRA" Style="{x:StaticResource LabelLeftMenu}" x:Name="open_kultura" Padding="10"/>
<Label Text="KÖZÉLET" Style="{x:StaticResource LabelLeftMenu}" x:Name="open_kozelet" Padding="10"/>
<Label Text="ÉLETMÓD" Style="{x:StaticResource LabelLeftMenu}" x:Name="open_eletmod" Padding="10"/>
<Label Text="GAZDASÁG" Style="{x:StaticResource LabelLeftMenu}" x:Name="open_gazdasag" Padding="10"/>
<Label Text="SZÍNES" Style="{x:StaticResource LabelLeftMenu}" x:Name="open_szines" Padding="10"/>
<Label Text="RÓLUNK" Style="{x:StaticResource LabelLeftMenu}" x:Name="open_rolunk" Padding="10"/>
</StackLayout>
</SwipeItemView>
</SwipeItems>
</SwipeView.LeftItems>
</SwipeView>
但它并不完美。它不能完全打开我用共享coed测试过,很有趣。你的也一样。也许这是SwipeView的问题 但是,我有一个解决方法。您可以为SwipeItemView的子视图添加WidthRequest。如下所示:设置宽度请求=100 其效果是:
此外,您可以将其作为问题提交到Github,以便在那里进行后续处理,以了解其是否已解决。Hi,您的意思是第二次swipview显示时?
MainSwipe.Open(OpenSwipeItem.LeftItems);
<SwipeView x:Name="swipeView" HeightRequest="300">
<SwipeView.LeftItems>
<SwipeItems>
<SwipeItemView>
<StackLayout BackgroundColor="#208b55"
Orientation="Vertical"
WidthRequest="100"
Margin="20">
...
</StackLayout>
</SwipeItemView>
</SwipeItems>
</SwipeView.LeftItems>