0

it appers like this i have this xml :

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
android:padding="8dp">


<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <RelativeLayout
        android:id="@+id/layout_comands"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:layoutDirection="ltr">

        <TextView
            android:id="@+id/textView_hfccomands"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_marginBottom="@dimen/activity_horizontal_margin"
            android:text="text " />

        <ImageView
            android:id="@+id/imageView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_below="@id/textView_hfccomands"
            app:srcCompat="@drawable/ic_business_index" />

        <TextView
            android:id="@+id/textView_hfc_content"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/imageView"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_below="@id/textView_hfccomands"
            android:layout_toLeftOf="@id/imageView"
            android:layoutDirection="rtl"
            android:text="text " />


    </RelativeLayout>

    <View
        android:id="@+id/seprator1"
        android:layout_width="match_parent"
        android:layout_height="3dp"
        android:layout_below="@id/layout_comands"
        android:layout_marginTop="@dimen/main_screen_bottom_margings"
        android:background="@color/light_blue" />


    <RelativeLayout
        android:id="@+id/layout_lvExpMissions"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/seprator1"
        android:layout_marginTop="@dimen/main_screen_bottom_margings"
        android:background="@color/white">

        <ExpandableListView
            android:id="@+id/lvExphfc_my_missions"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </RelativeLayout>

    <View
        android:id="@+id/seprator2"
        android:layout_width="match_parent"
        android:layout_height="3dp"
        android:layout_below="@id/layout_lvExpMissions"
        android:background="@color/light_blue"></View>


    <RelativeLayout
        android:id="@+id/layout_button_help"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/seprator2"
        android:layout_marginTop="@dimen/main_screen_bottom_margings">

        <Button
            android:id="@+id/button_help"
            style="@style/button_custmoized"
            android:layout_width="match_parent"
            android:layout_height="60dp" />

    </RelativeLayout>

    <View
        android:id="@+id/seprator3"
        android:layout_width="match_parent"
        android:layout_height="3dp"
        android:layout_below="@id/layout_button_help"
        android:layout_marginTop="@dimen/main_screen_bottom_margings"
        android:background="@color/light_blue"></View>


    <RelativeLayout
        android:id="@+id/layot_emergency_reports"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/seprator3"
        android:layout_marginTop="@dimen/main_screen_bottom_margings"
        android:background="@color/white">

        <ListView
            android:id="@+id/listView_emergencyReports"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </RelativeLayout>

    <View
        android:id="@+id/seprator4"
        android:layout_width="match_parent"
        android:layout_height="8dp"
        android:layout_below="@id/layot_emergency_reports"
        android:layout_marginTop="@dimen/main_screen_bottom_margings"
        android:background="@color/light_blue"></View>

</RelativeLayout>

the proplem is my scroll view some way wrap the content and act wierd ! i just want to be able to scroll the whole content down but the scroll view push the relative layut to the top of the screen! what did i miss here

this who it shows if i change my parent scrollview to relativelayout

Community
  • 1
  • 1
danny
  • 147
  • 1
  • 15

2 Answers2

1

add this code to your relative layout in xml

android:focusableInTouchMode="true"

android:visibility="visible"

try this

0

Add this property to ScrollView in xml

android:fillViewport="true"

it will solve the issue.

Muhib Pirani
  • 765
  • 1
  • 6
  • 15
  • is the view fitting whole screen on device? if yes , try running it on a device having smaller screen size. – Muhib Pirani Jun 13 '17 at 13:22
  • no the view dosent fit the whole screen , as in the above sceenshot , i can scrool the list view but i want to be able to scroll the whole view mening when i scroll down the upper layouts go up – danny Jun 13 '17 at 13:52
  • Use NestedScrollView instead of ScrollView – Muhib Pirani Jun 13 '17 at 14:08
  • the nested scroll ivew didnt solve my proplem .. im missing something here what is it ? – danny Jun 13 '17 at 14:32