I have three imageButtons inside an horizontal linearlayout and I want to add one more imageButton right under the up left imageButton(when the up left imageButton starts and finishes, I want the same thing for the imageButton under that). Everything is in a vertital linearlayout. I cannot align the down imageButton vertically with the up one. How can I do that? Any ideas?
My code is this:
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:gravity="center">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButton11"
android:background="@drawable/image"
android:layout_gravity="center"
android:layout_marginRight="30dp"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButton12"
android:background="@drawable/image"
android:layout_gravity="center"
android:layout_marginRight="30dp"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButton13"
android:background="@drawable/image"
android:layout_gravity="center"
android:layout_marginRight="30dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:gravity="left">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButton14"
android:background="@drawable/image"
android:layout_marginRight="30dp"/>
</LinearLayout>