主菜单在移动设备上不可见,但在平板电脑上可见 [英] Master menu is not visible on mobile devices but is visible on tablet

查看:44
本文介绍了主菜单在移动设备上不可见,但在平板电脑上可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 sap.m.SplitApp 控件创建了一个拆分应用程序.

I have created a split app using the sap.m.SplitApp control.

移动设备:

iPad:

推荐答案

我相信这是预期的行为.

I believe this is the intended behaviour.

请参阅此 github 问题:https://github.com/SAP/openui5/issues/30

See this github issue: https://github.com/SAP/openui5/issues/30

其中一位开发人员说

SplitApp 的设计行为类似于例如iPhone 上的设置"应用程序,其中平板电脑上的主从结构映射到手机上的一组线性页面.因此,不显示Show Master"按钮是正确的.

The SplitApp is designed to behave like e.g. the "Settings" app on iPhone, where a master-detail structure on tablet is mapped to a linear set of pages on phone. As such it is correct not to display a "Show Master" button.

但是,他们建议如下

在手机上没有主按钮,但您应该首先看到主区域,然后通过选择项目从那里导航到详细信息区域.

On phones there is no master button, but you should initially see the master area and navigate from there to the detail area by selecting items.

要实现此目的,您可以执行以下操作:您的详细信息页面应包含一个按钮,您可以使用该按钮导航回主视图(此按钮仅在设备为手机时才可见):

To achieve this you can do the following: Your detail pages should contain a button with which you can navigate back to the master view (this button should only be visible if the device is a phone):

<Page id="detailPage" showNavButton="{device>/isPhone}" navButtonPress="handleNavButtonPress">
</Page>

navButtonPress 处理程序在详细视图的控制器中实现

The navButtonPress handler is implemented in your detail view's controller

handleNavButtonPress: function () {
    var oSplitApp = this.getView().getParent().getParent();
    var oMaster = oSplitApp.getMasterPages()[0];
    oSplitApp.toMaster(oMaster, "flip");
}

<小时>

我使用的device模型可以如下实现(把这段代码放在你的Component.js


The device model I used can be implemented as follows (place this code in the init of your Component.js

var deviceModel = new sap.ui.model.json.JSONModel({
    isPhone: sap.ui.Device.system.phone
});
this.setModel(deviceModel, "device");

有关更多信息,请参阅此资源:http://help.sap.com/saphelp_hanaplatform/helpdata/en/32/5b8edafcfa4c9c8fbd42455a60e379/content.htm

See this resource for further information: http://help.sap.com/saphelp_hanaplatform/helpdata/en/32/5b8edafcfa4c9c8fbd42455a60e379/content.htm

这篇关于主菜单在移动设备上不可见,但在平板电脑上可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆