宽度和选项菜单的高度? [英] Width and height of an Options Menu?

查看:157
本文介绍了宽度和选项菜单的高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法得到一个的宽度和高度选项菜单在DPI(或其他测量)?

Is there a way to get the width and height of an Options Menu in DPI (or any other measurement)?

推荐答案

据我了解 - NO

As I understand - NO.

当您打开选项菜单中新的窗口创建 - 专门为显示菜单。而从活动(和它的窗口)没有办法取得另一个窗口的一些信息。

When you open option menu new Window created - specially for showing menu. And from activity(and it's window) there is not way to get some information about another windows.

有关控制布局,你可以尝试找到菜单窗口的布局,并检查有多少DP它。(所有非标准Android的布局是在文件夹sdk_folder /平台/平台-X /数据/ RES /布局)但这不是最好的办法 - 这将是平台相关的,如果例如HTC提供他们自己的选择菜单 - 你将有问题。

For controlling layout you can try to find layout of menu window, and check how many dp it is.(all standart android layouts is in folder sdk_folder/platforms/platform-x/data/res/layout) But this is not the best way - it will be platform-dependent, and if for example HTC provide there own option menus - you will have problems.

这篇关于宽度和选项菜单的高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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