永久性底部下拉不使用滑动刷新布局和网络视图

cidc1ykv  于 2021-09-13  发布在  Java
关注(0)|答案(0)|浏览(283)

我已经创建了一个底部表单。在展开底部工作表后,我无法将其向下拉,因为需要滑动以刷新布局。当我删除“滑动刷新”布局时,拖动或向下滑动即可。我在多个位置和类中使用相同的ui,因此我无法删除“滑动刷新”,只有在从底部工作表调用时才能禁用。如何通过滑动下拉底部工作表来刷新布局和网络视图。我已经创建了一个演示项目,下面是代码。

public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    SwipeRefreshLayout swipe = findViewById(R.id.swipe);
    swipe.setRefreshing(false);
    swipe.setEnabled(false);
    WebView mywebview = (WebView) findViewById(R.id.webView1);
    mywebview.setWebViewClient(new WebViewClient());
    mywebview.loadUrl("https://stackoverflow.com");
}
}

 <?xml version="1.0" encoding="utf-8"?>
 <androidx.coordinatorlayout.widget.CoordinatorLayout
 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">
 <FrameLayout
    android:id="@+id/bottom_sheet"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:behavior_hideable="true"
    app:behavior_peekHeight="55dp"
    app:layout_behavior="@string/bottom_sheet_behavior">

    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
        android:id="@+id/swipe"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

       <WebView
           android:id="@+id/webView1"
           android:layout_width="match_parent"
           android:layout_height="match_parent"/>

    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
  </FrameLayout>
 </androidx.coordinatorlayout.widget.CoordinatorLayout>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题