android: fix blank scrollview layout?











up vote
0
down vote

favorite












My goal is to show a toolbar at the top of the view, then a TextView, then a ScrollView section and then a footer that always shows at the bottom of the view. The below only shows the toolbar and the TextView header. Nothing is showing for the ScrollView section or for the footer at the bottom. What am I missing here?



EditActivity.xml

<RelativeLayout

xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:focusableInTouchMode="true"
tools:context=".EditActivity">

<include
android:id="@+id/toolbar"
layout="@layout/toolbar" >
</include>

<RelativeLayout android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_below="@+id/toolbar" >

<TextView
android:id="@+id/create_skycard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/colorFlLabelFinal"
android:textAppearance="?android:attr/textAppearanceLarge"
android:clickable="false" />

</RelativeLayout>

<RelativeLayout android:id="@+id/myFooter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >

<ViewFlipper
android:id="@+id/viewFlipper1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp" >

<include layout="@layout/cardview_nobuttons"
android:id="@+id/cardviewNobuttons" />

<include layout="@layout/cardview_previewbuttons"
android:id="@+id/cardviewPreviewbuttons" />

</ViewFlipper>

</RelativeLayout>

<ScrollView
android:id="@+id/ScrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/header"
android:layout_above="@+id/myFooter"
android:fillViewport="true" >

<LinearLayout
android:id="@+id/LinearLayout1"
style="@style/scrollbar_shape_style"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<com.wimso.v108.widget.EditText
... />

</LinearLayout>

</ScrollView>

</RelativeLayout>









share|improve this question
























  • My guess to another way of doing this: you should create a root RelativeLayout containing a LinearLayout and a RelativeLayout, the linearLayout can hold the toolbar, search bar and the scrollview. While the relative layout should be align ParentBottom = true to hold the footer.
    – Reda
    Nov 11 at 2:47










  • Ok, making progress. The ScrollView now shows correctly but the RelativeLayout is not at the bottom of the screen, it is overlayed across the top of the view, over the toolbar. Any thoughts on how to fix?
    – AJW
    Nov 11 at 2:56















up vote
0
down vote

favorite












My goal is to show a toolbar at the top of the view, then a TextView, then a ScrollView section and then a footer that always shows at the bottom of the view. The below only shows the toolbar and the TextView header. Nothing is showing for the ScrollView section or for the footer at the bottom. What am I missing here?



EditActivity.xml

<RelativeLayout

xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:focusableInTouchMode="true"
tools:context=".EditActivity">

<include
android:id="@+id/toolbar"
layout="@layout/toolbar" >
</include>

<RelativeLayout android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_below="@+id/toolbar" >

<TextView
android:id="@+id/create_skycard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/colorFlLabelFinal"
android:textAppearance="?android:attr/textAppearanceLarge"
android:clickable="false" />

</RelativeLayout>

<RelativeLayout android:id="@+id/myFooter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >

<ViewFlipper
android:id="@+id/viewFlipper1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp" >

<include layout="@layout/cardview_nobuttons"
android:id="@+id/cardviewNobuttons" />

<include layout="@layout/cardview_previewbuttons"
android:id="@+id/cardviewPreviewbuttons" />

</ViewFlipper>

</RelativeLayout>

<ScrollView
android:id="@+id/ScrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/header"
android:layout_above="@+id/myFooter"
android:fillViewport="true" >

<LinearLayout
android:id="@+id/LinearLayout1"
style="@style/scrollbar_shape_style"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<com.wimso.v108.widget.EditText
... />

</LinearLayout>

</ScrollView>

</RelativeLayout>









share|improve this question
























  • My guess to another way of doing this: you should create a root RelativeLayout containing a LinearLayout and a RelativeLayout, the linearLayout can hold the toolbar, search bar and the scrollview. While the relative layout should be align ParentBottom = true to hold the footer.
    – Reda
    Nov 11 at 2:47










  • Ok, making progress. The ScrollView now shows correctly but the RelativeLayout is not at the bottom of the screen, it is overlayed across the top of the view, over the toolbar. Any thoughts on how to fix?
    – AJW
    Nov 11 at 2:56













up vote
0
down vote

favorite









up vote
0
down vote

favorite











My goal is to show a toolbar at the top of the view, then a TextView, then a ScrollView section and then a footer that always shows at the bottom of the view. The below only shows the toolbar and the TextView header. Nothing is showing for the ScrollView section or for the footer at the bottom. What am I missing here?



EditActivity.xml

<RelativeLayout

xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:focusableInTouchMode="true"
tools:context=".EditActivity">

<include
android:id="@+id/toolbar"
layout="@layout/toolbar" >
</include>

<RelativeLayout android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_below="@+id/toolbar" >

<TextView
android:id="@+id/create_skycard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/colorFlLabelFinal"
android:textAppearance="?android:attr/textAppearanceLarge"
android:clickable="false" />

</RelativeLayout>

<RelativeLayout android:id="@+id/myFooter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >

<ViewFlipper
android:id="@+id/viewFlipper1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp" >

<include layout="@layout/cardview_nobuttons"
android:id="@+id/cardviewNobuttons" />

<include layout="@layout/cardview_previewbuttons"
android:id="@+id/cardviewPreviewbuttons" />

</ViewFlipper>

</RelativeLayout>

<ScrollView
android:id="@+id/ScrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/header"
android:layout_above="@+id/myFooter"
android:fillViewport="true" >

<LinearLayout
android:id="@+id/LinearLayout1"
style="@style/scrollbar_shape_style"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<com.wimso.v108.widget.EditText
... />

</LinearLayout>

</ScrollView>

</RelativeLayout>









share|improve this question















My goal is to show a toolbar at the top of the view, then a TextView, then a ScrollView section and then a footer that always shows at the bottom of the view. The below only shows the toolbar and the TextView header. Nothing is showing for the ScrollView section or for the footer at the bottom. What am I missing here?



EditActivity.xml

<RelativeLayout

xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:focusableInTouchMode="true"
tools:context=".EditActivity">

<include
android:id="@+id/toolbar"
layout="@layout/toolbar" >
</include>

<RelativeLayout android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_below="@+id/toolbar" >

<TextView
android:id="@+id/create_skycard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/colorFlLabelFinal"
android:textAppearance="?android:attr/textAppearanceLarge"
android:clickable="false" />

</RelativeLayout>

<RelativeLayout android:id="@+id/myFooter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >

<ViewFlipper
android:id="@+id/viewFlipper1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp" >

<include layout="@layout/cardview_nobuttons"
android:id="@+id/cardviewNobuttons" />

<include layout="@layout/cardview_previewbuttons"
android:id="@+id/cardviewPreviewbuttons" />

</ViewFlipper>

</RelativeLayout>

<ScrollView
android:id="@+id/ScrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/header"
android:layout_above="@+id/myFooter"
android:fillViewport="true" >

<LinearLayout
android:id="@+id/LinearLayout1"
style="@style/scrollbar_shape_style"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<com.wimso.v108.widget.EditText
... />

</LinearLayout>

</ScrollView>

</RelativeLayout>






android android-linearlayout android-scrollview android-relativelayout






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 17 at 0:53









Onik

11k103761




11k103761










asked Nov 11 at 2:29









AJW

99931840




99931840












  • My guess to another way of doing this: you should create a root RelativeLayout containing a LinearLayout and a RelativeLayout, the linearLayout can hold the toolbar, search bar and the scrollview. While the relative layout should be align ParentBottom = true to hold the footer.
    – Reda
    Nov 11 at 2:47










  • Ok, making progress. The ScrollView now shows correctly but the RelativeLayout is not at the bottom of the screen, it is overlayed across the top of the view, over the toolbar. Any thoughts on how to fix?
    – AJW
    Nov 11 at 2:56


















  • My guess to another way of doing this: you should create a root RelativeLayout containing a LinearLayout and a RelativeLayout, the linearLayout can hold the toolbar, search bar and the scrollview. While the relative layout should be align ParentBottom = true to hold the footer.
    – Reda
    Nov 11 at 2:47










  • Ok, making progress. The ScrollView now shows correctly but the RelativeLayout is not at the bottom of the screen, it is overlayed across the top of the view, over the toolbar. Any thoughts on how to fix?
    – AJW
    Nov 11 at 2:56
















My guess to another way of doing this: you should create a root RelativeLayout containing a LinearLayout and a RelativeLayout, the linearLayout can hold the toolbar, search bar and the scrollview. While the relative layout should be align ParentBottom = true to hold the footer.
– Reda
Nov 11 at 2:47




My guess to another way of doing this: you should create a root RelativeLayout containing a LinearLayout and a RelativeLayout, the linearLayout can hold the toolbar, search bar and the scrollview. While the relative layout should be align ParentBottom = true to hold the footer.
– Reda
Nov 11 at 2:47












Ok, making progress. The ScrollView now shows correctly but the RelativeLayout is not at the bottom of the screen, it is overlayed across the top of the view, over the toolbar. Any thoughts on how to fix?
– AJW
Nov 11 at 2:56




Ok, making progress. The ScrollView now shows correctly but the RelativeLayout is not at the bottom of the screen, it is overlayed across the top of the view, over the toolbar. Any thoughts on how to fix?
– AJW
Nov 11 at 2:56












1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










First of all, you should limit height of footer view. I set the ViewFlipper's height to 128dp for test, so you can calculate your own based on its content.



Second: You should set android:layout_alignParentTop="true" for the include which its id is toolbar. To do this you should set height and weight for it as I did.



Third: The height of the ScrollView should be wrap_content instead of match_parent to be sure it stretches between header and footer views.



Here is your layout source code after applying the above corrections:



<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:focusableInTouchMode="true"
tools:context=".EditActivity">

<include
android:id="@+id/toolbar"
layout="@layout/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" />

<RelativeLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/toolbar"
android:gravity="center_horizontal">

<TextView
android:id="@+id/create_skycard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="false"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/colorFlLabelFinal"
android:textStyle="bold" />

</RelativeLayout>

<ScrollView
android:id="@+id/ScrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/myFooter"
android:layout_below="@+id/header"
android:fillViewport="true">

<LinearLayout
android:id="@+id/LinearLayout1"
style="@style/scrollbar_shape_style"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<com.wimso.v108.widget.EditText
... />

</LinearLayout>

</ScrollView>

<RelativeLayout
android:id="@+id/myFooter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">

<ViewFlipper
android:id="@+id/viewFlipper1"
android:layout_width="match_parent"
android:layout_height="128dp"
android:layout_marginBottom="5dp">

<include
android:id="@+id/cardviewNobuttons"
layout="@layout/cardview_nobuttons" />

<include
android:id="@+id/cardviewPreviewbuttons"
layout="@layout/cardview_previewbuttons" />

</ViewFlipper>

</RelativeLayout>

</RelativeLayout>





share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245338%2fandroid-fix-blank-scrollview-layout%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    First of all, you should limit height of footer view. I set the ViewFlipper's height to 128dp for test, so you can calculate your own based on its content.



    Second: You should set android:layout_alignParentTop="true" for the include which its id is toolbar. To do this you should set height and weight for it as I did.



    Third: The height of the ScrollView should be wrap_content instead of match_parent to be sure it stretches between header and footer views.



    Here is your layout source code after applying the above corrections:



    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFF"
    android:focusableInTouchMode="true"
    tools:context=".EditActivity">

    <include
    android:id="@+id/toolbar"
    layout="@layout/toolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true" />

    <RelativeLayout
    android:id="@+id/header"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/toolbar"
    android:gravity="center_horizontal">

    <TextView
    android:id="@+id/create_skycard"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:clickable="false"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textColor="@color/colorFlLabelFinal"
    android:textStyle="bold" />

    </RelativeLayout>

    <ScrollView
    android:id="@+id/ScrollView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_above="@+id/myFooter"
    android:layout_below="@+id/header"
    android:fillViewport="true">

    <LinearLayout
    android:id="@+id/LinearLayout1"
    style="@style/scrollbar_shape_style"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <com.wimso.v108.widget.EditText
    ... />

    </LinearLayout>

    </ScrollView>

    <RelativeLayout
    android:id="@+id/myFooter"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true">

    <ViewFlipper
    android:id="@+id/viewFlipper1"
    android:layout_width="match_parent"
    android:layout_height="128dp"
    android:layout_marginBottom="5dp">

    <include
    android:id="@+id/cardviewNobuttons"
    layout="@layout/cardview_nobuttons" />

    <include
    android:id="@+id/cardviewPreviewbuttons"
    layout="@layout/cardview_previewbuttons" />

    </ViewFlipper>

    </RelativeLayout>

    </RelativeLayout>





    share|improve this answer

























      up vote
      1
      down vote



      accepted










      First of all, you should limit height of footer view. I set the ViewFlipper's height to 128dp for test, so you can calculate your own based on its content.



      Second: You should set android:layout_alignParentTop="true" for the include which its id is toolbar. To do this you should set height and weight for it as I did.



      Third: The height of the ScrollView should be wrap_content instead of match_parent to be sure it stretches between header and footer views.



      Here is your layout source code after applying the above corrections:



      <?xml version="1.0" encoding="utf-8"?>
      <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#FFFFFF"
      android:focusableInTouchMode="true"
      tools:context=".EditActivity">

      <include
      android:id="@+id/toolbar"
      layout="@layout/toolbar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true" />

      <RelativeLayout
      android:id="@+id/header"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_below="@+id/toolbar"
      android:gravity="center_horizontal">

      <TextView
      android:id="@+id/create_skycard"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:clickable="false"
      android:textAppearance="?android:attr/textAppearanceLarge"
      android:textColor="@color/colorFlLabelFinal"
      android:textStyle="bold" />

      </RelativeLayout>

      <ScrollView
      android:id="@+id/ScrollView1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_above="@+id/myFooter"
      android:layout_below="@+id/header"
      android:fillViewport="true">

      <LinearLayout
      android:id="@+id/LinearLayout1"
      style="@style/scrollbar_shape_style"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical">

      <com.wimso.v108.widget.EditText
      ... />

      </LinearLayout>

      </ScrollView>

      <RelativeLayout
      android:id="@+id/myFooter"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true">

      <ViewFlipper
      android:id="@+id/viewFlipper1"
      android:layout_width="match_parent"
      android:layout_height="128dp"
      android:layout_marginBottom="5dp">

      <include
      android:id="@+id/cardviewNobuttons"
      layout="@layout/cardview_nobuttons" />

      <include
      android:id="@+id/cardviewPreviewbuttons"
      layout="@layout/cardview_previewbuttons" />

      </ViewFlipper>

      </RelativeLayout>

      </RelativeLayout>





      share|improve this answer























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        First of all, you should limit height of footer view. I set the ViewFlipper's height to 128dp for test, so you can calculate your own based on its content.



        Second: You should set android:layout_alignParentTop="true" for the include which its id is toolbar. To do this you should set height and weight for it as I did.



        Third: The height of the ScrollView should be wrap_content instead of match_parent to be sure it stretches between header and footer views.



        Here is your layout source code after applying the above corrections:



        <?xml version="1.0" encoding="utf-8"?>
        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#FFFFFF"
        android:focusableInTouchMode="true"
        tools:context=".EditActivity">

        <include
        android:id="@+id/toolbar"
        layout="@layout/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true" />

        <RelativeLayout
        android:id="@+id/header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/toolbar"
        android:gravity="center_horizontal">

        <TextView
        android:id="@+id/create_skycard"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="false"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="@color/colorFlLabelFinal"
        android:textStyle="bold" />

        </RelativeLayout>

        <ScrollView
        android:id="@+id/ScrollView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/myFooter"
        android:layout_below="@+id/header"
        android:fillViewport="true">

        <LinearLayout
        android:id="@+id/LinearLayout1"
        style="@style/scrollbar_shape_style"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <com.wimso.v108.widget.EditText
        ... />

        </LinearLayout>

        </ScrollView>

        <RelativeLayout
        android:id="@+id/myFooter"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true">

        <ViewFlipper
        android:id="@+id/viewFlipper1"
        android:layout_width="match_parent"
        android:layout_height="128dp"
        android:layout_marginBottom="5dp">

        <include
        android:id="@+id/cardviewNobuttons"
        layout="@layout/cardview_nobuttons" />

        <include
        android:id="@+id/cardviewPreviewbuttons"
        layout="@layout/cardview_previewbuttons" />

        </ViewFlipper>

        </RelativeLayout>

        </RelativeLayout>





        share|improve this answer












        First of all, you should limit height of footer view. I set the ViewFlipper's height to 128dp for test, so you can calculate your own based on its content.



        Second: You should set android:layout_alignParentTop="true" for the include which its id is toolbar. To do this you should set height and weight for it as I did.



        Third: The height of the ScrollView should be wrap_content instead of match_parent to be sure it stretches between header and footer views.



        Here is your layout source code after applying the above corrections:



        <?xml version="1.0" encoding="utf-8"?>
        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#FFFFFF"
        android:focusableInTouchMode="true"
        tools:context=".EditActivity">

        <include
        android:id="@+id/toolbar"
        layout="@layout/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true" />

        <RelativeLayout
        android:id="@+id/header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/toolbar"
        android:gravity="center_horizontal">

        <TextView
        android:id="@+id/create_skycard"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="false"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="@color/colorFlLabelFinal"
        android:textStyle="bold" />

        </RelativeLayout>

        <ScrollView
        android:id="@+id/ScrollView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/myFooter"
        android:layout_below="@+id/header"
        android:fillViewport="true">

        <LinearLayout
        android:id="@+id/LinearLayout1"
        style="@style/scrollbar_shape_style"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <com.wimso.v108.widget.EditText
        ... />

        </LinearLayout>

        </ScrollView>

        <RelativeLayout
        android:id="@+id/myFooter"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true">

        <ViewFlipper
        android:id="@+id/viewFlipper1"
        android:layout_width="match_parent"
        android:layout_height="128dp"
        android:layout_marginBottom="5dp">

        <include
        android:id="@+id/cardviewNobuttons"
        layout="@layout/cardview_nobuttons" />

        <include
        android:id="@+id/cardviewPreviewbuttons"
        layout="@layout/cardview_previewbuttons" />

        </ViewFlipper>

        </RelativeLayout>

        </RelativeLayout>






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 11 at 14:51









        aminography

        3,83821129




        3,83821129






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245338%2fandroid-fix-blank-scrollview-layout%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Florida Star v. B. J. F.

            Error while running script in elastic search , gateway timeout

            Adding quotations to stringified JSON object values