我是新手,正在学习Android开发,遇到了一些问题...
我使用SurfaceView扩展我的类。 在我的类中,我无法获取SurfaceView的宽度和高度。 它总是为0。我想在整个屏幕(surfaceView)上滑动图像,但无法获取其宽度和高度。
有什么建议吗?
这是main.xml中SurfaceView的代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<test.MyClass android:id="@+id/SurfaceView01"
android:layout_width="fill_parent" android:layout_height="fill_parent">
</test.MyClass>
</LinearLayout>