Jump to content

Многострочный EmptyText для unimMemo


x11

Recommended Posts

В unimMemo не помещается длинный текст для placeholder, для свойства EmptyText, внизу снимка видна полоса прокрутки.

Подскажите, пожалуйста, как правильно сделать перенос текста для placeholder, т.е. для свойства unimMemo1.EmptyText?

Т.е. placeholder должен быть многострочный, а сам основной текст должен зависеть от других настроек.

тег <br> не помогает

Спасибо.

Screenshot_21.jpg

Link to comment
Share on other sites

Сделал так, но может есть более правильный способ?

 

memoLog.EmptyText := 'строка 1' + sLineBreak + 'строка 2';

т.е. я же не знаю заранее ширину экрана смартфона и, как следствие, не знаю точно где нужно переносить текст.

Link to comment
Share on other sites

59 minutes ago, x11 said:

В unimMemo не помещается длинный текст для placeholder, для свойства EmptyText, внизу снимка видна полоса прокрутки.

Это когда установлен атрибут: setInputAttribute('wrap', 'off')?

Link to comment
Share on other sites

Вы можете применить следующие правила CSS, заменив input на textarea:

::-webkit-input-placeholder { /* Chrome/Opera/Safari */
  white-space:pre-line;  
  position:relative;
  top:-7px;
  
}
::-moz-placeholder { /* Firefox 19+ */
     white-space:pre-line;  
  position:relative;
  top:-7px;
}
:-ms-input-placeholder { /* IE 10+ */
    white-space:pre-line;  
  position:relative;
  top:-7px;
}
:-moz-placeholder { /* Firefox 18- */
     white-space:pre-line;  
  position:relative;
  top:-7px;
}

 

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...