Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid LinearLayout larger than screen height
    primarykey
    data
    text
    <p>I have a LinearLayout used by my Main Activity that looks as follows:</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" tools:context=".MainActivity" &gt; &lt;LinearLayout android:id="@+id/activity_main_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>I am <strong>dynamically adding fragments</strong> inside <strong>activity_main_container</strong> but the <strong>problem</strong> is, when my fragment height is larger than the screen height, the <strong>content at the bottom</strong> gets <strong>hidden</strong>. I am not able to scroll or do anything. </p> <p>I have tried wrapping the fragment's layout inside <strong>ScrollView</strong> but it won't work for me because I have listview inside my fragments. I've also tried <strong>setting layout height</strong> to say 3000dp on every container but it didn't work either.</p> <p>My fragment's sample layout that I am dynamically adding looks as follows. I am adding contents dynamically inside my fragment as well.</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/fragment_listing_detail_linearLayout_top" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#FFF" android:orientation="vertical" android:paddingLeft="@dimen/fragment_padding_side" android:paddingRight="@dimen/fragment_padding_side" &gt; &lt;TextView android:id="@+id/fragment_listing_detail_textview_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Review Title" android:textSize="20sp" android:textStyle="bold" /&gt; &lt;RatingBar android:id="@+id/fragment_listing_detail_ratingbar_rating" style="@style/customRatingBarSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:numStars="5" android:stepSize="0.5" android:isIndicator="true" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Photos" /&gt; &lt;View style="@style/divider" /&gt; &lt;HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingBottom="10dp" &gt; &lt;LinearLayout android:id="@+id/fragment_listing_detail_linearlayout_images" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" &gt; &lt;/LinearLayout&gt; &lt;/HorizontalScrollView&gt; &lt;TextView android:id="@+id/fragment_listing_detail_textview_review" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Reviews" /&gt; &lt;View style="@style/divider" /&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;ImageView android:layout_width="match_parent" android:paddingTop ="7dp" android:paddingBottom="7dp" android:layout_height="wrap_content" android:contentDescription="review divisor" android:src="@android:drawable/divider_horizontal_bright" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/fragment_listing_detail_reviews_fragment_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" &gt; &lt;/LinearLayout&gt; &lt;Button android:id="@+id/fragment_listing_detail_button_add_review" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Add Review" /&gt; &lt;ImageView android:id="@+id/fragment_listing_detail_imageview_testimage" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>How do I make it so that when my fragment goes beyond screen height, I can still scroll to see the bottom views? Thanks.</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