Note that there are some explanatory texts on larger screens.

plurals
  1. POView layout after setvisibility
    text
    copied!<p>I've got problem with setting visibility to relative layout. I have part of big layout in relativelayout and below that next TextView. But in my code, when <code>myRelativeLayout.setVisibility(View.GONE);</code> is called, TextView which is below that did not appear. I tried several ways to rearange layout, but i need that textview under it. Thanks</p> <p>My XML:</p> <pre><code>&lt;merge xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;ScrollView android:id="@+id/scrollView_liab_ra_flipper_04" android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;RelativeLayout android:id="@+id/linearLayout_liab_ra_flipper_04" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/someTextView" android:text="Something" /&gt; &lt;!-- This relative layout should be removable --&gt; &lt;RelativeLayout android:id="@+id/vg_liab_ra_04_flipper_car_container_visible" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/someTextView" &gt; &lt;TextView android:id="@+id/tv_1" style="@style/WhiteFormText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="15dp" android:layout_marginTop="2dp" android:text="@string/licence_plate_counter" &gt; &lt;/TextView&gt; &lt;EditText android:id="@+id/et_1" style="@style/WhiteFormField" android:layout_below="@+id/tv_1" android:hint="@string/licence_plate_hint" &gt; &lt;/EditText&gt; &lt;/RelativeLayout&gt; &lt;!-- This textview is not visible if relative layout is gone --&gt; &lt;TextView android:id="@+id/tv_liab_ra_04_flipper_mandat" style="@style/WhiteFormTextHint" android:layout_below="@+id/vg_liab_ra_04_flipper_car_container_visible" android:layout_marginBottom="15dp" android:text="@string/mandatory_field" &gt; &lt;/TextView&gt; &lt;/RelativeLayout&gt; &lt;/ScrollView&gt; &lt;/merge&gt; </code></pre> <p>Java Code:</p> <pre><code> private void hideCar() { if (!accident.getParticipant(0)) { rlCarContainer.setVisibility(View.GONE); } else { rlCarContainer.setVisibility(View.VISIBLE); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload