2011-12-24 10 views
0

は、私は私のニーズに、より良いフィットするレイアウト知りません。GridViewのかRelativelayout

私は左の4つのボタン、右側に4つのボタンを持っていると思います。 と私はこれらのボタンにドラッグ&ドロップを実装する場合、私は別の上に一つのボタンをドラッグします。 completlyそれが戻って昔の位置に取得する必要他のボタンの上にドラッグありえないボタンは、それ以外の場合は、ボタンをオーバーレイする必要がある場合。

私はレイアウトは、このための優れている知っている...あなたは私にヒントを与えることができますいけませんか?

GridViewの中の位置パラメータのようなものがあれば、私はもちろん、これを取るでしょうに..しかし、私は、任意のを見つけたhaventは。.. http://developer.android.com/resources/tutorials/views/hello-gridview.html

私は線形で同様のことをした

答えて

0

ありがとうレイアウト。あなたの必要性に合っているかもしれません。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:orientation="horizontal" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:weightSum="3" 
      android:gravity="center_vertical"> 
<LinearLayout android:id="@+id/layoutLeft" 
       android:orientation="vertical" 
       android:layout_weight="1" 
       android:layout_width="wrap_content" 
       android:layout_height="fill_parent" 
       android:gravity="center_horizontal|center_vertical"> 

    <ImageButton /> 
    <ImageButton /> 
    <ImageButton /> 

</LinearLayout> 

<LinearLayout android:layout_width="wrap_content" 
       android:layout_height="fill_parent" 
       android:gravity="center_horizontal" 
       android:layout_weight="1" 
       android:orientation="vertical"> 
</LinearLayout> 

<LinearLayout android:id="@+id/layoutRight" 
       android:orientation="vertical" 
       android:layout_weight="1" 
       android:layout_width="wrap_content" 
       android:layout_height="fill_parent" 
       android:gravity="center_horizontal|center_vertical"> 

    <ImageButton /> 
    <ImageButton /> 
    <ImageButton /> 

</LinearLayout> 
</LinearLayout> 
0

ポジショニングやボタンを再位置決めしながら、それは複数の画面サイズをサポートし、あなたが問題を持っていないので、私は、相対的なレイアウトを言うと思います。

+0

ええ..しかし、どのようにそれをドラッグした後、あなたはボタンの位置を覚えていますか? – krackmoe

+0

私はそれ以外の方法はありませんが、それを追跡すると思います。 – Ghost