Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vertical label alignment in SAPUI5 (Label too high)

Tags:

css

label

sapui5

I am currently working on my first SAPUI5 mobile application. I found the options for horizontal layout positioning, but my labels are shown "too high". For display I am using Google Chrome.

My page theme is sap_bluecrystal and the content structure is as follows:

sap.ui.layout.form.SimpleForm (Max Container Cols: 2)
--> sap.m.Label (Text: Name, LabelFor: "Name")
--> sap.m.Input (Id: "Name")

There are some more fields following the same structure. The result is:

Label too high

Has someone an idea how to solve this problem?

Thank you in advance, Best Regards, Jonathan

like image 965
Jonathan Avatar asked Mar 11 '15 08:03

Jonathan


People also ask

Which alignment is supported in label?

Both top and side alignment of labels have benefits and drawbacks. Top alignment or side alignment (right justified) are advised.


1 Answers

You can use the editable property like this:

<f:SimpleForm id="form"
  editable="true">
  <f:content>
    <Label
      text="Name"
      labelFor="Name" />
    <Input id="Name"
      value="DJ" />
  </f:content>
</f:SimpleForm>

That should do what you need.

Here's an example (switch the switch to turn this on and off to see the effect).

like image 133
qmacro Avatar answered Sep 18 '22 14:09

qmacro