android滚动整个屏幕不仅listview

时间:2017-04-18 16:35:50

标签: android xml

我在顶部有一个图像滑块,下面是列表视图。 listview滚动但滑块保持静态我想要的是,如果我滚动,滑块也应该上升。请提供解决方案this is my layout

这是我的xml代码

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.dzone.image_ki_duniya.MainActivity">

<com.daimajia.slider.library.SliderLayout
    android:id="@+id/cover"
    android:layout_width="match_parent"
    custom:pager_animation="Accordion"
    custom:auto_cycle="true"
    custom:indicator_visibility="visible"
    custom:pager_animation_span="1100"
    android:layout_height="200dp"/>

<com.daimajia.slider.library.Indicators.PagerIndicator
    android:id="@+id/custom_indicator"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center"
    custom:selected_color="#0095BF"
    custom:unselected_color="#55333333"
    custom:selected_drawable="@drawable/left"
    custom:shape="oval"
    custom:selected_padding_left="6dp"
    custom:selected_padding_right="6dp"
    custom:unselected_padding_left="2dp"
    custom:unselected_padding_right="2dp"
    android:layout_centerHorizontal="true"
    android:layout_alignParentBottom="true"
    custom:selected_width="6dp"
    custom:selected_height="6dp"
    custom:unselected_width="6dp"
    custom:unselected_height="6dp"
    android:layout_marginBottom="20dp"
    />
<!--<com.daimajia.slider.library.Indicators.PagerIndicator-->
    <!--android:id="@+id/custom_indicator2"-->
    <!--style="@style/AndroidImageSlider_Corner_Oval_Orange"-->
    <!--android:layout_centerHorizontal="true"-->
    <!--android:layout_alignParentBottom="true"-->
    <!--android:layout_marginBottom="20dp"-->
    <!--/>-->


<ListView
    android:id="@+id/listview"
    android:layout_marginTop="5dp"
    android:layout_below="@+id/cover"
    android:layout_width="match_parent"
    android:layout_height="match_parent"></ListView>

1 个答案:

答案 0 :(得分:0)

将所有内容放在滚动视图中。确保,scrollview只能托管一个父视图。