本文介绍了在三星Galaxy S3选项菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能迫使三星Galaxy S3有选项菜单固定possition在屏幕的右上角,因为它是在其他流行的手机?在三星Galaxy S3的选项菜单仅在菜单按钮。我想放在应用程序内置帮助在固定的地方在所有类型的设备。

Is it possible to force Samsung Galaxy S3 to have a fixed possition of the option menu in the top right corner of the screen as it is in other popular phones? In Samsung Galaxy S3 option menu is available only under the menu button. I would like to place a built-in help in the app in a fixed place in all types of devices.

我不知道,如果同样的问题出现在其他类型的手机/平板电脑。

I'm not sure if similar problem appears in other types of phones/tablets.

推荐答案

使用您的活动code这个模块包含选项菜单。结果

Use this block of code in your activity which contains option Menu.

try {
    ViewConfiguration config = ViewConfiguration.get(BaseActivity.this);
    Field menuKeyField = ViewConfiguration.class
            .getDeclaredField("sHasPermanentMenuKey");
    if (menuKeyField != null) {
        menuKeyField.setAccessible(true);
        menuKeyField.setBoolean(config, false);
    }
} catch (Exception e) {
    e.printStackTrace();
}

该块使用可以从操作栏的右上角访问选项menues。照片甚至在三星Galaxy S3,当您点击菜单按钮,然后菜单选项从操作栏右上角打开。
请尝试使用以下menu.xml文件
结果

by this block use can access option menues from top right corner of action bar.
even on Samsung Galaxy S3 when you click menu button, then option menu will open from action bar top right corner.try using following menu.xml

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:orderInCategory="2"
        android:title="Home"/>
    <item
        android:id="@+id/logs"
        android:orderInCategory="3"
        android:title="Logs"/>
    <item
        android:id="@+id/support"
        android:orderInCategory="4"
        android:title="Support"/>
    <item
        android:id="@+id/logout"
        android:orderInCategory="5"
        android:title="Logout"/>

</menu>

这篇关于在三星Galaxy S3选项菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-19 00:09