public void Update()
        {
            var text = _formsLabel.Text;

            if (text == null)
            {
                return;
            }

            var multiple    = (float)AlterLineHeight.GetMultiple(_formsLabel);
            var fontSize    = (float)(_formsLabel).FontSize;
            var lineSpacing = (fontSize * multiple) - fontSize;
            var pStyle      = new NSMutableParagraphStyle()
            {
                LineSpacing = lineSpacing,
                Alignment   = _formsLabel.HorizontalTextAlignment.ToNativeTextAlignment()
            };
            var attrString = new NSMutableAttributedString(text);

            attrString.AddAttribute(UIStringAttributeKey.ParagraphStyle,
                                    pStyle,
                                    new NSRange(0, attrString.Length));

            _nativeLabel.AttributedText = attrString;

            ChangeSize();
        }
예제 #2
0
        public void Update()
        {
            _editText.AfterTextChanged -= _editText_AfterTextChanged;
            _multiple = (float)AlterLineHeight.GetMultiple(_formsElement);

            _editText.SetLineSpacing(1f, _multiple);
            _editText.AfterTextChanged += _editText_AfterTextChanged;
        }
예제 #3
0
        public void Update()
        {
            var multiple    = AlterLineHeight.GetMultiple(_formsEditor);
            var fontSize    = (float)(_formsEditor).FontSize;
            var lineSpacing = (fontSize * multiple) - fontSize;

            _manager.LineSpacing = (float)lineSpacing;

            _nativeTextView.Text = _nativeTextView.Text;
        }
        public void Update()
        {
            _multiple = (float)AlterLineHeight.GetMultiple(_formsElement);

            _textView.SetLineSpacing(1f, _multiple);

            if (!_isFixedHeight && _formsElement.Height >= 0)
            {
                var size = _formsElement.Height * (_multiple / _preMultiple);
                _formsElement.HeightRequest = size;
            }

            _preMultiple = _multiple;
        }
        public void Update()
        {
            _multiple = (float)AlterLineHeight.GetMultiple(_formsElement);

            _textView.SetLineSpacing(1f, _multiple);

            if (!_isFixedHeight && _formsElement.Height >= 0)
            {
                var size = _formsElement.Height * (_multiple / _preMultiple);
                _formsElement.Layout(new Rectangle(_formsElement.Bounds.X, _formsElement.Bounds.Y, _formsElement.Bounds.Width, size));
            }

            _preMultiple = _multiple;
        }
예제 #6
0
        public void Update()
        {
            var multiple    = AlterLineHeight.GetMultiple(_formsEditor);
            var fontSize    = (float)(_formsEditor).FontSize;
            var lineSpacing = (fontSize * multiple) - fontSize;

            var text = _formsEditor.Text;

            var pStyle = new NSMutableParagraphStyle()
            {
                LineSpacing = (float)lineSpacing
            };
            var attrString = new NSMutableAttributedString(text);

            attrString.AddAttribute(UIStringAttributeKey.ParagraphStyle,
                                    pStyle,
                                    new NSRange(0, attrString.Length));

            attrString.AddAttribute(UIStringAttributeKey.Font, _nativeTextView.Font, new NSRange(0, attrString.Length));
            attrString.AddAttribute(UIStringAttributeKey.ForegroundColor, _nativeTextView.TextColor, new NSRange(0, attrString.Length));

            _nativeTextView.AttributedText = attrString;
        }