Пример #1
0
 private void BeginPost(Api.Post post)
 {
     content.Children.Add(new BoxView()
     {
         HeightRequest = 5,
         Color         = Color.Silver
     });
 }
Пример #2
0
        private void EndPost(Api.Post post)
        {
            var refen = new Label()
            {
                Text              = " 引用 ",
                TextColor         = Color.Blue,
                FontSize          = 10,
                HorizontalOptions = LayoutOptions.End
            };

            refen.GestureRecognizers.Add(new TapGestureRecognizer()
            {
                Command = new Command(() => { PostReference(post.Id, "aa"); })
            });
            var reply = new Label()
            {
                Text              = " 回复 ",
                TextColor         = Color.Blue,
                FontSize          = 10,
                HorizontalOptions = LayoutOptions.End
            };

            reply.GestureRecognizers.Add(new TapGestureRecognizer()
            {
                Command = new Command(() => { PostReply(post.Id, "aa"); })
            });
            content.Children.Add(new StackLayout()
            {
                Orientation = StackOrientation.Horizontal,
                Spacing     = 0,
                Children    =
                {
                    new Label()
                    {
                        Text              = post.PostAuthor,
                        TextColor         = Color.Gray,
                        FontSize          = 10,
                        HorizontalOptions = LayoutOptions.StartAndExpand
                    },
                    new Label()
                    {
                        Text              = post.PostTime,
                        TextColor         = Color.Gray,
                        FontSize          = 10,
                        HorizontalOptions = LayoutOptions.End
                    },
                    refen, reply
                }
            });
        }