Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

TableView Height Pushing Button to Bottom of Page

$
0
0

I am using the following code to create a simple login page.
The problem I am having is that the "Login" button is displaying at the bottom of the page, and not directly below the TableView.

Any help or guidance is greatly appreciated.
Thanks!!!

Code........
`
namespace TDMS
{
public class Login : ContentPage
{
public Login ()
{
Label lblBlank = new Label {
Text = " ",
};

        Image img = new Image {
            Source = ImageSource.FromFile ("Logo.png"),

        };

        TableView tv = new TableView {
            Intent = TableIntent.Form,
            BackgroundColor = Color.FromRgb (237, 131, 34),
            //SeparatorStyle = UITableViewCellSeparatorStyle.None,
            Root = new TableRoot ("User Login") {
                new TableSection ("") {
                    new EntryCell {
                        Label = "User Name:",
                        Placeholder = "Enter User Name",
                        Keyboard = Keyboard.Default
                    },
                    new EntryCell {
                        Label = "Password:",
                        Placeholder = "Enter Password",
                        Keyboard = Keyboard.Default
                    },
                }
            }
        };

        Button btn = new Button {
            Text = "Login",
            Font = Font.SystemFontOfSize(12, FontAttributes.Bold)
        };

        this.BackgroundColor = Color.FromRgb (237, 131, 34);
        Content = new StackLayout { 
            Children = {
                lblBlank,
                lblBlank,
                img,
                tv,
                btn
            }
        };
    }
}

}
`


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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