我想在調用SwipeRefreshLayout Listener時將整個佈局向下移動?這是東西在Android中possile?? 這是我的整個xml layout.SwipeRefreshLayout包含一個progressbar和FrameLayout,它包含在RelativeLayout.So中,我希望FrameLyout在我呼叫刷新時拉下來。在swipeRefreshLayoutListener上拉下整個佈局android
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_navigation_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar_layout" />
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipeRefresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ProgressBar
android:id="@+id/horizontal_sync_progress"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gradient_bg_end"
android:indeterminateDrawable="@drawable/progress_drawable"
android:progressDrawable="@drawable/progress_drawable"
android:visibility="gone"/>
<FrameLayout
android:id="@+id/container_frag"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
</LinearLayout>
您嘗試到現在爲止?請發佈一些代碼 –
你必須在xml文件的頂部設置SwipeRefreshLayout。 –
雅..我會分享我的xml – Divya