public static void LayoutLabeledField(this ILabeledField field, LayoutBuilder layout) { var label = layout.View(field.Label) .Left(20).AutoHeight().Width(Pixel.Val(field.LabelWidth)).CenterVertically(); layout.View(field.Text) .After(label.LayoutBounds, 9.5f).AutoHeight().Right(0).CenterVertically(); }
protected override void CreateView() { base.CreateView(); this.SetBackgroundColor(Theme.Colors.BG); Title.Title.SetText(Theme.HeadlineText("Profile")); FirstName.Label.SetText("First Name"); FirstName.Text.SetHintText(Theme.TableTextFieldPlaceholderText("Add your name")); LastName.Label.SetText("Last Name"); LastName.Text.SetHintText(Theme.TableTextFieldPlaceholderText("Add your name")); BirthDate.Label.SetText("Birth Date"); BirthDate.Text.SetHintText(Theme.TableTextFieldPlaceholderText("Choose your birthdate")); Email.Label.SetText("Email"); Email.Text.SetHintText(Theme.TableTextFieldPlaceholderText("Add your email")); PhoneNumber.Label.SetText("Phone Number"); PhoneNumber.Text.SetHintText(Theme.TableTextFieldPlaceholderText("Add your phone number")); NotificationSettings.Title.SetText("Notification Settings"); NotificationSettings.Icon.SetText(Icons.Notification); ChangePassword.Title.SetText("Change Password"); ChangePassword.Icon.SetText(Icons.ChangePassword); LogOut.Title.SetText("Log Out"); LogOut.Icon.SetText(Icons.LogOut); var views = new List <List <QView> > { new List <QView> { new QView(FirstName), new QView(LastName), new QView(BirthDate) }, new List <QView> { new QView(Email), new QView(PhoneNumber) }, new List <QView> { new QView(NotificationSettings), new QView(ChangePassword) }, new List <QView> { new QView(LogOut) } }; Form.SetContent(new FormContent(views, this, Builder)); TextFields = new ILabeledField[] { FirstName, LastName, BirthDate, Email, PhoneNumber }; AlignTextFieldLabelsWidth(new SizeF(10000, 10000), TextFields); PlatformCreate(); }
public static void TextField(ILabeledField field) { field.Label.SetTextColor(Colors.TableFieldLabelText); field.Label.SetBackgroundColor(RGB.Clear); field.Label.SetFont(Fonts.TableFieldLabel); field.Text.SetTextColor(Colors.TableFieldText); field.Text.SetBackgroundColor(RGB.Clear); TextFieldDefaults(field.Text); }