Skip to Content
0
Aug 27, 2020 at 10:49 AM

vAlign doenst work on a label in a xml view

159 Views

Hi,

i'm trying align a label in SAP UI5 vertically to an input field in the same line, vAlign is indeed documented as applicable on a label and descripted like (https://sapui5.hana.ondemand.com/#/api/sap.m.Label%23controlProperties):

Specifies the vertical alignment of the Label related to the tallest and lowest element on the line.

Since my only other element in the line next to the label is an input field, this should be an easy job. To my surpirise, valign doesnt seems to cause any changes in the layout. My idea to use it would be like:

            <App id="app">


                       
<pages>


                                   
<Page title="{i18n>title}">


                                   
           
<content>


                                                           
<l:VerticalLayout width="100%">


                                                                       
<l:Grid defaultSpan="L6 M6 S6" containerQuery="true"
hSpacing="1" vSpacing="1" position="Center">


                                                                                                           
<Label vAlign="Middle" text="{i18n>solManReq}" labelFor="solManReqInput"/>


                                                                                                           
<Input id="solManReqInput"
class="sapUiSmallMarginBottom" type="Text"


                                                                                                                       
valueStateText="Solution manager change request number must not be
empty"


                                                                                                                       
value="{ path : '/name', type : 'sap.ui.model.type.String', constraints :
{ minLength: 1, maxLength: 10 } }" showValueHelp="true"


                                                                                                           
            valueHelpRequest="helpRequestSolManId"/>