简体   繁体   English

Android Java中可动态编辑的弹出菜单

[英]Dynamically editable pop-up menus in Android Java

I'm working with an existing Android app and I need to have a dynamically editable pop-up menu or something functionally equivalent. 我正在使用现有的Android应用程序,因此需要一个可动态编辑的弹出菜单或功能上等效的菜单。 I want the menu to appear at the bottom of the screen or the top (out of the way, the user needs to see what is going on with the screen). 我希望菜单显示在屏幕的底部或顶部(顺便说一句,用户需要查看屏幕上发生了什么)。 That menu will display information, not options to select, based on what the user changes on the screen. 该菜单将基于用户在屏幕上所做的更改显示信息, 而不显示要选择的选项。

My current attempts include using menuinflater to get a menu xml file to the bottom of the screen, which works, but I can't dynamically edit the names of the items in the xml file while the app is running. 我目前的尝试包括使用menuinflater将菜单xml文件获取到屏幕底部,该方法可以工作,但是在应用程序运行时,我无法在xml文件中动态编辑项目名称。

Any thoughts on how I could accomplish this? 关于如何实现此目标有任何想法吗?

You can go about this in a number of ways. 您可以通过多种方式解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM