コード例 #1
0
        public BottomPage()
        {
            Title = "Bottom";

            tray = new Tray(TrayOrientation.Bottom, 0.5)
            {
                VerticalOptions = LayoutOptions.End,
            };

            tray.Content = new ContentView {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                BackgroundColor   = Color.Red
            };

            Button switchTray = new Button {
                Text         = "Open/Close Tray",
                WidthRequest = 0.5 * App.ScreenWidth
            };

            switchTray.Clicked += ToggleTray;

            AbsoluteLayout layout = new AbsoluteLayout()
            {
                HeightRequest   = App.ScreenHeight,
                WidthRequest    = App.ScreenWidth,
                BackgroundColor = Color.Yellow
            };

            layout.Children.Add(switchTray, new Rectangle(App.ScreenWidth * 0.25, 100, switchTray.WidthRequest, 50));
            layout.Children.Add(tray, new Rectangle(0, App.ScreenHeight, App.ScreenWidth, tray.HeightRequest));

            Content = layout;
        }
コード例 #2
0
 public TrayEventArgs(Tray tray)
 {
     this.tray = tray;
 }