Xamarin.Forms SwipeView Open does not work property

Steven Alexander Checo Terrero 1 Reputation point
2021-02-26T07:28:04.53+00:00

When I used swipeView.Open(OpenSwipeItem.RightItems) and I try to click on the button for the first time, SwipeView doesn't open full size, I had to click to close and click back to open again to see Items full size

72346-inkedscreenshot-1614324269-li.jpg

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,325 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JarvanZhang 23,951 Reputation points
    2021-02-26T08:32:01.353+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    wipeView doesn't open full size, I had to click to close and click back to open again to see Items full size

    I created a basic demo to test the function, it works fine. Here is the related code, you could refer to it.

       <SwipeView x:Name="swipe">  
           <SwipeView.RightItems>  
               <SwipeItems>  
                   <SwipeItem Text="Favorite" BackgroundColor="LightGreen" />  
                   <SwipeItem Text="Delete" BackgroundColor="LightPink"/>  
               </SwipeItems>  
           </SwipeView.RightItems>  
           <Grid HeightRequest="60" WidthRequest="300" BackgroundColor="LightGray">  
               <Label Text="Swipe right" HorizontalOptions="Center" VerticalOptions="Center" />  
           </Grid>  
       </SwipeView>  
    

    Button click event:

       bool IsOpened;  
       private async void Button_Clicked(object sender, EventArgs e)  
       {  
           if (!IsOpened)  
           {  
               swipe.Open(OpenSwipeItem.RightItems);  
               IsOpened = true;  
           }  
           else  
           {  
               swipe.Close();  
               IsOpened = false;  
           }  
       }  
    

    If the code doesn't works on your side, please update the Xamarin.Forms package to the lastest stable version.

    Best Regards,

    Jarvan Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments