public EntryCellView(Cell formsCell) : base(formsCell) { ValueField = new UITextField // TODO: enable multi-line entries { BorderStyle = UITextBorderStyle.None, AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight, ReturnKeyType = UIReturnKeyType.Done, }; ValueField.TouchUpInside += ValueFieldOnTouchUpInside; ValueField.EditingChanged += TextField_EditingChanged; ValueField.EditingDidBegin += ValueField_EditingDidBegin; ValueField.EditingDidEnd += ValueField_EditingDidEnd; ValueField.ShouldReturn = OnShouldReturn; _EntryCell.Focused += EntryCell_Focused; _FieldWrapper = new UIView { AutosizesSubviews = true }; _FieldWrapper.SetContentHuggingPriority(100f, UILayoutConstraintAxis.Horizontal); _FieldWrapper.SetContentCompressionResistancePriority(100f, UILayoutConstraintAxis.Horizontal); _FieldWrapper.AddSubview(ValueField); ContentStack.AddArrangedSubview(_FieldWrapper); }
/// <summary> /// Initializes a new instance of the <see cref="T:AiForms.Renderers.iOS.LabelCellView"/> class. /// </summary> /// <param name="formsCell">Forms cell.</param> public LabelCellView(Cell formsCell) : base(formsCell) { ValueLabel = new UILabel(); ValueLabel.TextAlignment = UITextAlignment.Right; ContentStack.AddArrangedSubview(ValueLabel); ValueLabel.SetContentHuggingPriority(100f, UILayoutConstraintAxis.Horizontal); ValueLabel.SetContentCompressionResistancePriority(100f, UILayoutConstraintAxis.Horizontal); }
/// <summary> /// Initializes a new instance of the <see cref="T:AiForms.Renderers.iOS.EntryCellView"/> class. /// </summary> /// <param name="formsCell">Forms cell.</param> public EntryCellView(Cell formsCell) : base(formsCell) { ValueField = new UITextField() { BorderStyle = UITextBorderStyle.None }; ValueField.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; ValueField.EditingChanged += _textField_EditingChanged; ValueField.ShouldReturn = OnShouldReturn; _FieldWrapper = new UIView(); _FieldWrapper.AutosizesSubviews = true; _FieldWrapper.SetContentHuggingPriority(100f, UILayoutConstraintAxis.Horizontal); _FieldWrapper.SetContentCompressionResistancePriority(100f, UILayoutConstraintAxis.Horizontal); _FieldWrapper.AddSubview(ValueField); ContentStack.AddArrangedSubview(_FieldWrapper); }