Closed kruemelmonstr closed 4 years ago
I think it's not a bug but I don't like it. I used this CSS and works.
.sapMBarTitleStart .sapMBarPH { text-align: center; }
Hello,
This is a feature. There is a property called titleAlignment, with this property you can align the page title. . If set to TitleAlignment.Auto, the Title will be aligned as it is set in the theme (if not set, the default value is center); Other possible values are TitleAlignment.Start (left or right depending on LTR/RTL), and TitleAlignment.Center (centered).
Best Regards, Tsanislav
Hey @tsanislavgatev , thanks for you response. I didn't noticed this new property. I am now seeing that the change was announced in the change log. Is there an easy way to set this option globally without creating a complete new custom theme?
Hi kruemelmonstr, you just need to set the provided property to what your needs are.
Regards, Mihail.
Hi,
to add a the property works, but it shows an error in the Web IDE
@tfey - maybe the schema files you are using for validation are not up to date.
AFAIK, WebIDE takes the information for XMLView validation from the release that is configured as minVersion for the app (but I'm not 100% sure).
I changed the theme from sap_fiori3 to sap_belize and title began showing in the middle of the page.
@prtkkr ; it worked for me too. Big Thanks
@prtkkr @HarikrishnaTheDeveloper @kruemelmonstr @portatifparcacik Guys, just change the titleAlignment
to "Center"
. No need to change or create an entire custom theme.
@kruemelmonstr Re: @tfey - maybe the schema files you are using for validation are not up to date.
I give up, how do you update them? I see the same thing.
@tsanislavgatev
This is a feature. There is a property called titleAlignment, with this property you can align the page title. . If set to TitleAlignment.Auto, the Title will be aligned as it is set in the theme (if not set, the default value is center); Other possible values are TitleAlignment.Start (left or right depending on LTR/RTL), and TitleAlignment.Center (centered).
It doesn't work. SAPUI5 version 1.87.0. Context:
`
<content>
...
</content>
`
In the running application the property is set to Auto. Title is not centered. And setting it in the controller onInit() didn't work either.
More context: this is when the application is deployed in a SuccessFactors extension. The title is centered when I run it in WebIDE without setting titleAlignment. In the SF extension the title text is left justified and titleAlignment is set to Auto despite attempts to set it to Center.
@dxlaw It's a property of the Page
, not of the Bar, see @tfey's comment and screenshot above.
@codeworrior It's also a property of sap.m.Bar which is where I'm trying to center Title text. But adding titleAlignment to Page worked. Thanks.
I don't know the Page
control in detail, but from the code, it looks as if the Page
's titleAlignment
will always override a titleAlignment
that has been set on the header
or customHeader
, whenever that header has a setTitleAlignment
method.
Hey UI5 Team,
I am currently facing a bug or feature for the component sap.m.Page. Titles are not getting centered anymore if I am using a OpenUI5 version newer than 1.71.4. I tested this with Chrome and Safari on MacOS. Seems like there are two style classes applied on the title and ".sapMBarTitleStart .sapMBarPH" is overriding ".sapMBarMiddle".
OpenUI5 version: 1.72.0 and later
Browser/version (+device/version): Chrome (78.0.3904.108) on MacOS
Any other tested browsers/devices(OK/FAIL): Safari (13.0.3) on MacOS MS Edge
URL (minimal example if possible): OpenUI5 Samples
User/password (if required and possible - do not post any confidential information here):
Steps to reproduce the problem:
What is the expected result? a centered title css is text-align: center
What happens instead? title is aligned to the left css is text-align: start
Any other information? (attach screenshot if possible)