Forum Xamarin Xamarin.Android

hide the stackliyout

hello good day I have a icon in the toolbar (search icon) when this icon clicked i want to hide a stackliyout on the main page how can I do it

Best Answer

Answers

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    StackLayout in android?
  • YorkGoYorkGo CNMember, Xamarin Team Xamurai

    How did you add the icon to your Toolbar, directly add it in Toolbar.axml? Please post your code.

  • abdalrhmanabdalrhman Member ✭✭
    edited December 2018
    > @AlessandroCaliaro said:
    > StackLayout in android?

    yes in android like this


    <StackLayout>
    <Lable Text="click in the serach icon to do hide mi "><\Lable>
    <\Stacklyout>

    the search icon it is on ToolBar (difirent page)
  • abdalrhmanabdalrhman Member ✭✭

    @YorkGo said:
    @abdalhasan , you could try using MessagingCenter:

    When you click the icon:

    MessagingCenter.Send<YourCurrentPage, string>(YourCurrentPage, "Hide_StackLayout",args);
    

    In your StackLayout Page ,add;

    MessagingCenter.Subscribe<YourCurrentPage, string>(this, "Hide_StackLayout", (arg1, arg2) =>{ Hide_StackLayout()});
    
    private void Hide_StackLayout()
    {
        //
     }   
    

    Thanks it's work for me

Sign In or Register to comment.