Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

My button do not appear in my App

$
0
0

I create this button and listview. I know that lack something, but i don't know what. This is my code

protected override async void OnAppearing()
        {
            base.OnAppearing();

            //Task.Run(async () => await CarregaDados(IdOrcamento)).GetAwaiter().GetResult();
            await CarregaDados(IdOrcamento);

            Entry ent = new Entry
            {
                Placeholder = "Motivo"
            };


            Button btnOk = new Button
            {
                Text = "Aprovar",
                BackgroundColor = Color.Gold,
                Font = Font.Default,
                FontSize = 10,
                TextColor = Color.Green,
                HeightRequest = 35,
                WidthRequest = 80
            };

            Button btnCancel = new Button
            {
                Text = "Negar",
                BackgroundColor = Color.Gold,
                Font = Font.Default,
                FontSize = 10,
                TextColor = Color.Green,
                HeightRequest = 35,
                WidthRequest = 80
            };

            Button btnVoltar = new Button
            {
                Text = "Voltar",
                BackgroundColor = Color.Gold,
                Font = Font.Default,
                FontSize = 10,
                TextColor = Color.Red,
                HeightRequest = 35,
                WidthRequest = 80
            };

            btnVoltar.Clicked += Voltar;


            ListView lv = new ListView()
            {
                HasUnevenRows = true,
                SeparatorVisibility = SeparatorVisibility.Default,
                BackgroundColor = Color.White,
                SeparatorColor = Color.Gold,
                SelectedItem = "lv_ItemSelected",
                WidthRequest = 240,
                HeightRequest = 180
            };


            lv.ItemsSource = _data;

            lv.ItemTemplate = new DataTemplate(typeof(ListItemCell));
            lv.ItemTemplate.SetBinding(TextCell.TextProperty, "Produto");
            lv.ItemTemplate.SetBinding(TextCell.DetailProperty, "DadosItens");

            this.Content = lv;

        }

        private static void Voltar(object sender, EventArgs e)
        {

        }

How can I do to appear in my App?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>