Note that there are some explanatory texts on larger screens.

plurals
  1. POListView layout changes not working
    primarykey
    data
    text
    <p>I have recently noticed that the search feature I implemented on my ListView has stopped working properly and I cannot figure out why...</p> <p>When the user selects the search action icon, a search box appears at the top and adjusts the ListView accordingly... at least it used to.</p> <p>The problem I am having is that the "search" box now longer "pushes" the ListView down instead appears over it. </p> <p>Here is an example...</p> <p><img src="https://i.stack.imgur.com/cHuQF.jpg" alt="enter image description here"></p> <p>And here is the layout XML...</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:animateLayoutChanges="true" &gt; &lt;FrameLayout android:id="@+id/search_frame" android:layout_width="fill_parent" android:layout_height="wrap_content" android:visibility="gone" &gt; &lt;!-- Editext for Search --&gt; &lt;EditText android:id="@+id/inputSearch" android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputType="textVisiblePassword" /&gt; &lt;Button android:id="@+id/btnClearText" android:layout_width="wrap_content" android:layout_height="30dp" android:layout_gravity="right" android:background="@android:color/transparent" android:onClick="clearSearch" android:paddingRight="10dp" android:text="X" android:textColor="#B3B3B3" /&gt; &lt;/FrameLayout&gt; &lt;!-- List View --&gt; &lt;ListView android:id="@+id/list_view" android:layout_width="fill_parent" android:layout_height="wrap_content" android:overScrollMode="never" /&gt; &lt;!-- Navigarion Drawer (Thought this might be casing the problem, but is still broken when removed) &lt;ListView android:id="@+id/left_drawer" android:layout_width="240dp" android:layout_height="match_parent" android:layout_gravity="start" android:background="#f9f9f9" android:choiceMode="singleChoice" android:divider="#919191" android:dividerHeight="0dp" /&gt; --&gt; &lt;/android.support.v4.widget.DrawerLayout&gt; </code></pre> <p>And the simple Java code to show the View...</p> <pre><code>/** * Show / Hide the search box */ private void showSearch() { try { //in the instance there are not items...a crash will occur when searching if(items.length &gt; 0) { if(searchFrame.getVisibility() == View.VISIBLE)//hide the search bar { searchFrame.setVisibility(View.GONE); resetList(); } else//show the search bar { searchFrame.setVisibility(View.VISIBLE); } } } catch(Exception e) { Library.errorHandler("showSearch", e); } } </code></pre> <p>Any ideas..?</p> <p>Thanks</p> <p>EDIT: I have now found out it is the android.support.v4.widget.DrawerLayout. If i use a LinearLayout it works fine.</p> <p>But now I cannot use the Navigation Drawer :(</p> <p>How would i go about using both the LinearLayout and DrawerLayout?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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