【问题标题】:Draw SurfaceView from layout xml, Ask information about answer从布局 xml 中绘制 SurfaceView,询问有关答案的信息
【发布时间】:2012-01-12 20:30:40
【问题描述】:

我找到了以下答案

Draw SurfaceView from layout xml

效果很好。但是,我不知道如何从扩展的 SurfaceDraw 类中调用方法/函数。我也不知道如何提出特定答案的问题。

看起来下面的代码应该可以工作。但是,无论我把它放在哪里,它都会生成一个空值,所以我无法调用方法/函数。

DrawingSurfaceView 绘图表面 = (DrawingSurfaceView)findViewById(R.id.DrawingSurfaceView);

DrawingSurfaceView.MyMethod();

我非常接近实现我的目标。非常感谢您对此问题的任何帮助。

我明白了。当系统允许时,我会发布一个分析器。

【问题讨论】:

    标签: android android-layout surfaceview


    【解决方案1】:

    我搬家了:

    DrawingSurfaceView drawingsurface = (DrawingSurfaceView)findViewById
      (R.id.DrawingSurfaceView);
    

    onCreate(),它开始工作了。

    【讨论】:

      猜你喜欢
      • 2011-07-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-28
      • 2014-03-08
      • 2015-12-19
      • 1970-01-01
      相关资源
      最近更新 更多