關於這個例子 - http://android-coding.blogspot.com/2011/05/detect-multi-touch-event-test-on-custom.html添加的EditText查看佈局
我如何添加的EditText的看法? 我試圖將其添加到佈局,但當我試圖更新它時,我收到錯誤消息。
謝謝
關於這個例子 - http://android-coding.blogspot.com/2011/05/detect-multi-touch-event-test-on-custom.html添加的EditText查看佈局
我如何添加的EditText的看法? 我試圖將其添加到佈局,但當我試圖更新它時,我收到錯誤消息。
謝謝
我在這裏找到一個很好的例子 - http://www.kellbot.com/2009/06/android-hello-circle。 我添加了EditText到佈局和它的工作正常。
爲了使用這個例子作爲Sebastien's comment解釋代碼應該寫的,他在其中使用其父在此行中描述:
final Activity parent = this;
從鏈接的MultiTouchView擴展視圖。您無法將其他視圖添加到視圖。您將需要MultiTouchView來擴展ViewGroup。請參閱構建custom components的Android文檔。
爲了能夠補充意見,我覺得跟
public class MultiTouchView extends FrameLayout {
替換以下行中的代碼示例
public class MultiTouchView extends View {
應該工作,因爲是的FrameLayout的ViewGroup的子類。您可能想根據您的需要選擇不同的佈局。
能否請您發佈錯誤消息 – Noel 2011-06-12 18:48:09