进度条在 Swiperefreshlayout 中显示更大
Progressbar shows larger in Swiperefreshlayout
我有带列表视图的选项卡视图,列表视图中显示的进度条非常大,我尝试将宽度和高度设置为 30dp 并且 match_parent 但没有用。进度条正在 onPreexecure 方法中加载。
这是我的 listview.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</ProgressBar>
<android.support.v7.widget.RecyclerView
android:id="@+id/recycleView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
这是我的输出截图
在 SwipeRefreshLayout
class 中说
This layout should be made the parent of the view that will be
refreshed as a result of the gesture and can only support one direct
child. This view will also be made the target of the gesture and
will be forced to match both the width and the height supplied in
this layout.
因此尝试在 SwipeRefreshLayout 之后添加一个 Relative 布局,并将其余代码放入其中
我有带列表视图的选项卡视图,列表视图中显示的进度条非常大,我尝试将宽度和高度设置为 30dp 并且 match_parent 但没有用。进度条正在 onPreexecure 方法中加载。
这是我的 listview.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</ProgressBar>
<android.support.v7.widget.RecyclerView
android:id="@+id/recycleView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
这是我的输出截图
在 SwipeRefreshLayout
class 中说
This layout should be made the parent of the view that will be refreshed as a result of the gesture and can only support one direct child. This view will also be made the target of the gesture and will be forced to match both the width and the height supplied in this layout.
因此尝试在 SwipeRefreshLayout 之后添加一个 Relative 布局,并将其余代码放入其中