loio |
---|
f94deb45de184a3a87850b75d610d9c0 |
view on: demo kit nightly build | demo kit latest release
The sap.m.Text
control allows you to display longer texts in your app, with the possibility to manage the number of lines, the text wrapping, and the visualization of line breaks and spacing.
You can influence the maximum number of visible lines by setting the maxLines
property to a numerical value. This option is only available when the wrapping
property is set to true. For more information, see the sap.m.Text - Max Lines Sample.
The Text control supports the rendering of new lines and the preservation of whitespace and tabs. Depending on whether you are using JavaScript or XML, or data binding, you need to consider specific aspects related to the definition of new lines and tabs.
sap.m.Text: New lines and tabs definition in the different use cases
To visualize |
JavaScript/Data binding defined string |
XML View defined string |
---|---|---|
New line |
|
|
\n For example, if you want to visualize |
|
|
Tab |
|
|
\t For example, if you want to visualize |
|
|
For more information, see the API Reference and the sap.m.Text - Render Whitespace Sample.
-
Use the Text control if you want to display text inside a form, table, or any other content area.
-
Do not use the Text control if you need a Label. For more information, see the API Reference:
sap.m.Label
. -
If you need special text formatting, use Formatted Text or HTML. For more information, see the API Reference:
sap.m.FormattedText
and API Reference:sap.ui.core.HTML
.
When you use wrapping, bear in mind that the multi-line overflow indicator depends on whether the browser supports line clamping. If the browser supports it, it shows the overflow as an ellipsis; if not, the overflow indicator is not displayed.