cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Label Text alignment

Former Member
0 Kudos

I am trying to align text in a label on a form. The textAlign property has values such as Left, Center and Right. However if my form has a gridLayout my labels ignore the textAlign property and align right. If my form has a ResponsiveLayout the lebels align left. I bleieve my syntax for the textAlign property is correct because when get errors if I make a typo but no errors when I type correctly. Can someone please advise?

The code I am using is

 

label: new sap.ui.commons.Label({text: "Name", textAlign : "left", layoutData: new sap.ui.commons.form.GridElementData({ hCells: "2"})}),

Thanks

Cliff

Accepted Solutions (0)

Answers (2)

Answers (2)

santhu_gowdaz
Active Contributor
0 Kudos

Hi Clifford,

               Replace left Property with sap.ui.core.TextAlign.Left.

example:- textAlign : sap.ui.core.TextAlign.Left.

Former Member
0 Kudos

great. worked for me.

Former Member
0 Kudos

I am also facing the same issue. Please let me know if you found a solution/workaround for this.

Former Member
0 Kudos

SAP acknowledge it as a bug but I'm not aware of whether they've addressed it.