Note that there are some explanatory texts on larger screens.

plurals
  1. POHorizontalscrollview does not wrap_content below a certain height
    primarykey
    data
    text
    <p>As you can see from the xml imagebutton,linearlayout and Horizontalscrollview have wrap_content for their height.But it seems that the Horizontalscrollview sometimes has more height than linearlayout.Its height is supposed to be equal to that of its child.</p> <p>How can I make the height of Horizontalscrollview equal to its child using wrap_content?</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scroll_buttons" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/bottom_bar_light" android:fillViewport="true" &gt; &lt;LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" &gt; &lt;ImageButton android:id="@+id/new_file" android:layout_width="75dp" android:layout_height="wrap_content" android:onClick="onClick" android:src="@drawable/new_item" /&gt; &lt;ImageButton android:id="@+id/multi_select" android:layout_width="75dp" android:layout_height="wrap_content" android:onClick="onClick" android:src="@drawable/discard_small" /&gt; &lt;ImageButton android:id="@+id/refresh" android:layout_width="75dp" android:layout_height="wrap_content" android:onClick="onClick" android:src="@drawable/refresh_small" /&gt; &lt;ImageButton android:id="@+id/home_grid" android:layout_width="75dp" android:layout_height="wrap_content" android:onClick="onClick" android:src="@drawable/grid_small" /&gt; &lt;ImageButton android:id="@+id/info_button" android:layout_width="75dp" android:layout_height="wrap_content" android:onClick="onClick" android:src="@drawable/info_small" /&gt; &lt;ImageButton android:id="@+id/exit" android:layout_width="75dp" android:layout_height="wrap_content" android:onClick="onClick" android:src="@drawable/exit" /&gt; &lt;/LinearLayout&gt; &lt;/HorizontalScrollView&gt; </code></pre> <p><img src="https://i.stack.imgur.com/4HEDY.png" alt="Screenshot"></p>
    singulars
    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