如果内容为 PAGE,则 SAP UI5 Popover 无法正确显示内容
SAP UI5 Popover not showing the content properly if the content is PAGE
我正在尝试将包含 page 的 XML view 作为内容,并将其放在 popover,xmlviewXML我用的视图是这样的,
<mvc:View controllerName="controllerPath"
xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
xmlns:core="sap.ui.core" height="100%" width="100%">
<Page height="100%"
width="100%">
<content>
//some content...
</content>
</Page>
</mvc:View>
我正在片段中创建这样的弹出窗口,
<core:FragmentDefinition
xmlns="sap.m"
xmlns:core="sap.ui.core">
<Popover
title="{Name}"
class="sapUiContentPadding"
placement="Bottom">
//placing above view here...
</Popover>
</core:FragmentDefinition>
但如果我这样做,由于某些高度问题,它不会在弹出框内显示页面。我想根据视图高度(弹出内容高度)设置弹出窗口的高度。我尝试使用弹出窗口 contentHeight="auto"
但这不会work.So如何根据内容显示弹出窗口?
sap.m.Page 控件没有高度和宽度 属性。但是,sap.ui.core.View 确实有高度和宽度 属性。因此,将宽度和高度分配给视图而不是页面。
代码:
<mvc:View controllerName="controllerPath"
xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
xmlns:core="sap.ui.core" height="50rem"
width="50rem">
<Page >
<content>
//some content...
</content>
</Page>
</mvc:View>
此外,让弹出框使用默认的宽度和高度。让我知道这是否符合您的要求。
更新:我为嵌入的视图提供了 100% 的高度和 100% 的宽度,还为 Popover 的 contentHeight 和 contentWidth 设置了 100%。我得到了整个页面。附上截图。
我正在尝试将包含 page 的 XML view 作为内容,并将其放在 popover,xmlviewXML我用的视图是这样的,
<mvc:View controllerName="controllerPath"
xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
xmlns:core="sap.ui.core" height="100%" width="100%">
<Page height="100%"
width="100%">
<content>
//some content...
</content>
</Page>
</mvc:View>
我正在片段中创建这样的弹出窗口,
<core:FragmentDefinition
xmlns="sap.m"
xmlns:core="sap.ui.core">
<Popover
title="{Name}"
class="sapUiContentPadding"
placement="Bottom">
//placing above view here...
</Popover>
</core:FragmentDefinition>
但如果我这样做,由于某些高度问题,它不会在弹出框内显示页面。我想根据视图高度(弹出内容高度)设置弹出窗口的高度。我尝试使用弹出窗口 contentHeight="auto" 但这不会work.So如何根据内容显示弹出窗口?
sap.m.Page 控件没有高度和宽度 属性。但是,sap.ui.core.View 确实有高度和宽度 属性。因此,将宽度和高度分配给视图而不是页面。
代码:
<mvc:View controllerName="controllerPath"
xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
xmlns:core="sap.ui.core" height="50rem"
width="50rem">
<Page >
<content>
//some content...
</content>
</Page>
</mvc:View>
此外,让弹出框使用默认的宽度和高度。让我知道这是否符合您的要求。
更新:我为嵌入的视图提供了 100% 的高度和 100% 的宽度,还为 Popover 的 contentHeight 和 contentWidth 设置了 100%。我得到了整个页面。附上截图。