Cannot fill up blank space with Linear layout

linear layout example
linear layout vs constraint layout
linear layout in android javatpoint
working with linear layout
android linearlayout spacing

I am designing a screen using linear layout.The screen looks like:

As you can see after the last layout some whitespace is coming up and I am not able to remove them.

The code:

        <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_scrollFlags="scroll">

            <LinearLayout
                android:id="@+id/menu_absent_container"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/black"
                android:layout_marginLeft="4dp"
                android:layout_marginRight="4dp"
                android:layout_marginTop="4dp"
                android:layout_marginBottom="4dp"
                android:padding="8dp"
                android:visibility="gone"
                android:gravity="center_horizontal"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/message"
                    style="@style/BodyStrong"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="left"
                    android:padding="8dp"
                    android:textColor="@color/white"
                    android:text="@string/default_store_message"
                    />

                <Button
                    android:id="@+id/navigate_default_menu"
                    style="@style/BodySmall"
                    android:layout_width="180dp"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp"
                    android:padding="4dp"
                    android:text="@string/default_menu"
                    android:contentDescription="@string/profile_allergies_chart"
                    android:textColor="@color/white_65_opacity"
                    android:background="@drawable/fav_box"
                    tools:ignore="MissingPrefix" />

                <Button
                    android:id="@+id/navigate_location"
                    style="@style/BodySmall"
                    android:layout_width="180dp"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="8dp"
                    android:padding="4dp"
                    android:text="@string/location_search"
                    android:contentDescription="@string/profile_allergies_chart"
                    android:textColor="@color/white_65_opacity"
                    android:background="@drawable/fav_box"
                    tools:ignore="MissingPrefix" />

            </LinearLayout>

            <android.support.v7.widget.RecyclerView
                android:id="@+id/sub_menus"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:background="@drawable/backgroundwhite"
                android:padding="2dp" />

            </FrameLayout>

Please note that there is also a recycler view.BUT it is hidden.I don`t think that it is the reason of the problem.

How do I remove the white space and make the linear layout to take the remaining space?

Edit: Changing Frame layout width to match_parent is not working

try to change the parent FrameLayout attributes

from

android:layout_height="wrap_content"

to

android:layout_height="match_parent"

Android LinearLayout View item in xml does not fill empty space , If you want to use the LinearLayout you can achieve what you want by using weightSum attribute in your LinearLayout and layout_weight for  When viewing or creating new viewports in AutoCAD, one or more of them display blank, showing no geometry from model space. Plot preview may still show things correctly. A large number of viewports have been opened in a drawing. Objects are located a long distance from the details and the view is zoomed out to its extents. Layers are turned off for the viewport. Corrupted layout. Legacy

Your FrameLayout is on wrap_content

Try this:

    <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_scrollFlags="scroll">

LinearLayout, The following snippet shows how to include a linear layout in your layout linear layout divides remaining space amongst the views it contains. Licensed to YouTube by. UMG (on behalf of Big Machine); Sony ATV Publishing, LatinAutor - SonyATV, LatinAutor, ASCAP, SOLAR Music Rights Management, UNIAO BRASILEIRA DE EDITORAS DE MUSICA - UBEM

Change android:layout_height="wrap_content" in your framelayout to android:layout_height="match_parent" to fill up all the space vertically and then do any other changes needed so that the nested layouts look nice.

Printer's Devil Review: Spring 2013 (Paperback), My stepson Henry is a fine and confident reader for his age (he will be nine in two weeks). of a shock to open the book to see a neat rectangle of text nearly filling the entire page, its expanse only broken up by a square-shaped blank space In “After Free Verse: The New Non-Linear Poetries,” Marjorie Perloff writes of the  I’m still optimistic flexbox will be a pretty standard layout mechanism on new sites within a year or so. If you only need flexbox for single-directional stuff, falling back to display: table is sometimes an option, if by fallback you mean to replicate the layout with some accuracy. If you need the wrapping, inline-block might work.

You should change your FrameLayout height attribute from wrap_content to match_parent

As wrap_content only occupy the space needed for your content not whole activity space.

              <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_scrollFlags="scroll">

Change:-

              <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_scrollFlags="scroll">

Understanding the behavior of Android Linear Layout and its major , The following snippet shows how to include a linear layout in your layout XML on individual child views to specify how linear layout divides remaining space  This will make your item Name to fill all the space until it reaches the last element. Note: When you use layout_weight you have to set the layout_width to 0dp. And also you should delete ems = 10 from your last element because it makes your notificationTimestamp element to have a larger width and it will push the Name element to the left leaving an empty space.

Android - Audience Network, Just after creating a linear layout you will need to specify android: orientation Then we can use layout_weight attribute for split space between 2 buttons equally. a vertical LinearLayout, the column will be push to the top side of the screen. Original title: i cannot fill in form for searching for cruise on holland america. I click on form and get blank screen and cannot type on it . I have been trying to search for a cruise on holland america website. I click on box, get a blank box, but cannot type in it.

How to set one layout over another in android, The Native Ad API allows you to build a customized experience for the ads you show NativeAdLayout which is a wrapper on top of a FrameLayout with some extra <LinearLayout xmlns:android="http://schemas.android.com/apk/res/​android" SDK Policy page for more details about white space unclickable enforcement. This causes that space in the page is lost and eventually the paragraph won't fit in the page because of this. Attached a picture as example. The reason is NOT that the borders of the image are set to X distance, in this example the Top border of the pic is set to zero, and yet the text won't fill down the column until reaching the picture, but

Working with the TextView, 22 May 2017 This is just a basic XML file that defines an ImageView on top of the It's basically a blank space on your Nov 16, 2015 · TextView is used to hold text Fragments must be embedded in activities; they cannot run independently of activities. 11 Sep 2014 By default, the layout view in Android (LinearLayout,  Check the paper size and page orientation selected in Print Setup (Windows) or Page Setup (Mac OS). Choose Layouts menu > Part Setup, and check each part for page break settings that should be disabled. For more information, see Defining page breaks and numbering. Delete the header part (or footer) part if they are not needed.

Comments
  • I think it's no whole layout. If match_parent in framenlayout doesn't work, there must be something in level upstairs frame, what lock it.