这是一个非常简单的javascript问题...但是我很挣扎,我试图从此表中放大字体,但无法从sytle.css中获取样式。有人可以向我解释为什么它不起作用以及实现此任务的最佳方法吗?我刚刚开始学习...非常感谢!
STYLE.CSS
.bigLabel {
font-size: 36px;
}
View.XML
<mvc:View xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:cd="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1" controllerName="zTESTJK1.zTESTJK1.controller.Main" displayBlock="true">
<App id="idAppControl">
<pages>
<Page title="{i18n>title}">
<content>
<List id="list0" items="{/PESListSet}" headerText="List">
<items>
<StandardListItem type="Navigation" title="{FinishCode1}" description="{Matnr}" icon="sap-icon://picture" id="item0"/>
</items>
</List>
<Table id="table0" items="{/PESListSet}" headerText="Web Paint Booth " class="bigLabel">
<items>
<ColumnListItem type="Active" id="item0_1536935024975" >
<cells>
<Label text="{FinishCode1}" id="text0" class="bigLabel"/>
<Text text="{Hqty}" id="text1"/>
<Text text=" { path: '/Htime/ms', type: 'sap.ui.model.type.Time', formatOptions: { source : { pattern : 'timestamp' }, pattern: 'HH:mm:ss' } }" id="text2"/>
<Text text="{Hpaint}" id="text3"/></cells>
</ColumnListItem>
</items>
<columns>
<Column id="column0">
<header>
<Label text="Finish" id="label0"/>
</header>
</Column>
<Column id="column1">
<header>
<Label text="Qty" id="label1"/>
</header>
</Column>
<Column id="column2">
<header>
<Label text="Time Hung" id="label2"/>
</header>
</Column>
<Column id="column3">
<header>
<Label text="Hand Paint" id="label3"/>
</header>
</Column>
</columns>
</Table>
</content>
</Page>
</pages>
</App>
答案 0 :(得分:0)
首先,在您的!important
中添加style.css
以覆盖ui5样式:
.bigLabel {
font-size: 36px !important;
}
第二,直接添加到每个控件class="bigLabel"
。每个控件直接包含应该在bigLabel类的font-size
中显示的文本:
<Table
id="table0"
items="{/PESListSet}"
headerText="Web Paint Booth">
<items>
<ColumnListItem
type="Active"
id="item0_1536935024975">
<cells>
<Label
text="{FinishCode1}"
id="text0"
class="bigLabel"/>
<Text
class="bigLabel"
text="{Hqty}"
id="text1"/>
<Text
class="bigLabel"
text="{
path: '/Htime/ms',
type: 'sap.ui.model.type.Time',
formatOptions: {
source: {
pattern: 'timestamp'
},
pattern: 'HH:mm:ss'
}
}"
id="text2"/>
<Text
class="bigLabel"
text="{Hpaint}"
id="text3"/>
</cells>
</ColumnListItem>
</items>
<columns>
<Column
id="column0">
<header>
<Label
class="bigLabel"
text="Finish"
id="label0"/>
</header>
</Column>
<Column
id="column1">
<header>
<Label
class="bigLabel"
text="Qty"
id="label1"/>
</header>
</Column>
<Column
id="column2">
<header>
<Label
class="bigLabel"
text="Time Hung"
id="label2"/>
</header>
</Column>
<Column
id="column3">
<header>
<Label
class="bigLabel"
text="Hand Paint"
id="label3"/>
</header>
</Column>
</columns>
</Table>