[問題] main.xml中如何使用mysurfaceview
因為我想在mysurfaceview上加幾個按鈕
所以要在xml中加入mysurfaceview,不過我發現在沒加按鈕進去,程式就不能work了
還要加什麼東西才能work嗎?
> < (<-青筋)
~"~ ^
這是acitivity的oncreate:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
msv=(MySurfaceView)findViewById(R.id.MySurfaceView1);
}
這是main.xml:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:baselineAligned="false"
android:orientation="horizontal" >
<test2.test2.test2.Test2Activity.MrawSurfaceView
android:id="@+id/mySurfaceView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</FrameLayout>
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 112.105.81.130
※ 編輯: viable 來自: 112.105.81.130 (03/08 19:13)
※ 編輯: viable 來自: 123.204.215.103 (03/12 01:09)