访问 SurfaceView 内的全局 EditText
主要活动是通过包含 EditText 和自定义 SurfaceView 的布局启动的。在 SurfaceView 类中,如何访问全局 EditText 对象?例如,如果我想设置EditText_object=VISIBLE?
The main activity is launched with a layout that includes a EditText and a custom SurfaceView. Inside the SurfaceView class, how can I access the global EditText object? For example, if I want to set EditText_object=VISIBLE?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能应该在代码中将 TextView 交给 SurfaceView 。换句话说,SurfaceView 是视图层次结构内部的东西,与文本视图无关;整个层次结构(通常是一个活动)有一些更大的所有者,应该负责管理它们之间的交互。
You should probably just hand the TextView to the SurfaceView in code. In other words, a SurfaceView is something inside the view hierarchy and unrelated to the text view; there is some larger owner of the entire hierarchy (often an activity) that should be responsible for managing the interaction between them.