2014-09-06 105 views
0

我是一個絕對的初學者與Android,我發現檢測multitouches一個代碼且將屏幕分成6個區域 這裏另一個碼對每個碼的佈局:把屏幕劃分成6個區域與檢測多觸摸

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" > 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_weight="1" 
    android:orientation="horizontal" > 

    <LinearLayout  
     android:background="@android:color/black" 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:orientation="horizontal" > 
    </LinearLayout> 

    <LinearLayout 
     android:background="@android:color/white" 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:orientation="horizontal" > 
    </LinearLayout> 
</LinearLayout> 


<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_weight="1" 
    android:orientation="horizontal" > 

    <LinearLayout 
     android:background="@android:color/black" 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:orientation="horizontal" > 
    </LinearLayout> 

    <LinearLayout 
     android:background="@android:color/darker_gray" 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:orientation="horizontal" > 
    </LinearLayout> 


</LinearLayout> 

<LinearLayout 

    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_weight="1" 
    android:orientation="horizontal" > 

    <LinearLayout 
     android:background="@android:color/white" 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:orientation="horizontal" > 
    </LinearLayout> 

    <LinearLayout 
     android:background="@android:color/black" 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:orientation="horizontal" > 
    </LinearLayout> 


</LinearLayout> 

佈局檢測multitouches:

<com.example.multitouch.MultitouchView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    /> 

我的問題是如何將這兩種佈局結合起來?以及如何知道每個區域在哪裏? 在此先感謝

+0

reffer this [post](http://stackoverflow.com/a/10463119/3326331) – 2014-09-06 09:21:47

回答

0

讓您的佈局的父 - RelativeLayout並添加Viewmatch_parent雙方規模以上你想要的所有意見。使用標誌View.INVISIBLE隱藏此視圖。 並添加到此視圖ScaleDetector。就這樣。

+0

嘿,謝謝你的回覆,但我可以與Skype聯繫嗎? – 2014-09-06 18:49:19

+0

@HayaD當然。趕上 - pandarium.shustikov – 2014-10-02 14:20:38

相關問題