(i have put the code at the end of my post)
i would like to make a hidden menu.
I don’t know if i take the good way.
I have some button visible, some invisible button and at the an another visible button.
One of the button in first layout have to set visible the hidden buttons.
I would like to have the last button just after the first bunch.
But like i have put invisible the Layout so i have an empty space.
I would like when i pressed the button for set visible that the last button go down.
I hope you will understand want i want to do and what i have done.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/fond"
>
<ImageView
android:id="@+id/imageView1"
android:contentDescription="@string/desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/top"
android:layout_gravity="top"
android:adjustViewBounds="true"
/>
<LinearLayout
android:layout_below="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/fond2"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="3"
>
<Button
android:id="@+id/button_garçon"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/Bg"
android:background="@drawable/button_purple"
android:layout_weight="1"
android:textColor="#ffffff"
android:onClick="actionGarçon"
/>
<Button
android:id="@+id/button_mixte"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/Bm"
android:background="@drawable/button_purple"
android:layout_weight="1"
android:textColor="#ffffff"
android:onClick="actionMixte"
/>
<Button
android:id="@+id/button_fille"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/Bf"
android:background="@drawable/button_purple"
android:layout_weight="1"
android:textColor="#ffffff"
android:onClick="actionFille"
/>
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="1"
>
<Button
android:id="@+id/button_param"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Bp"
android:background="@drawable/button_green"
android:layout_weight="1"
android:textColor="#ffffff"
android:onClick="actionParametre"
/>
</LinearLayout>
<!-- invisible -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="invisible"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/Tq"
android:textColor="#000000"
/>
<EditText android:id="@+id/edit_message"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/Emc"
android:singleLine="true"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/Tpre"
android:textColor="#000000"
/>
<EditText android:id="@+id/edit_message"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/Epre"
android:singleLine="true"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/Tsuf"
android:textColor="#000000"
/>
<EditText
android:id="@+id/edit_message"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/Esuf"
android:singleLine="true"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/Tl"
android:textColor="#000000"
/>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="100"
>
<Button android:id="@+id/button_court"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Blc"
android:layout_weight="25"
android:background="@drawable/button_purple"
android:textColor="#ffffff"
android:onClick="actionCourt"
/>
<Button android:id="@+id/button_moyen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Blm"
android:layout_weight="25"
android:background="@drawable/button_purple"
android:textColor="#ffffff"
android:onClick="actionMoyen"
/>
<Button android:id="@+id/button_long"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Bll"
android:layout_weight="25"
android:background="@drawable/button_purple"
android:textColor="#ffffff"
android:onClick="actionLong"
/>
<Button android:id="@+id/button_tous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Blt"
android:layout_weight="25"
android:background="@drawable/button_purple"
android:textColor="#ffffff"
android:onClick="actionTous"
android:state_pressed="true"
/>
</LinearLayout>
<Button android:id="@+id/button_orig"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/Bo"
android:background="@drawable/button_purple"
android:textColor="#ffffff"
android:onClick="actionOrigine"
/>
</LinearLayout>
<!-- /invisible -->
<Button android:id="@+id/button_recher"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/Br"
android:background="@drawable/button_green"
android:textColor="#ffffff"
android:onClick="actionRecherche"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Thanks in advance.
If I understand correctly you want to use
android:visibility="gone"so that what ever you set to"gone"does not occupy any space on the layout.Basically, instead of
android:visibility="invisible"you should useandroid:visibility="gone"See if that works.