gpt4 book ai didi

android - swipeRefreshLayout appcompat 圈

转载 作者:行者123 更新时间:2023-11-29 17:43:18 25 4
gpt4 key购买 nike

请告诉我,我怎样才能像这样制作swipeRefreshLayout

enter image description here

我的 swipeRefreshLayout 看起来像 enter image description here

我希望它看起来像一条线,而不是一个圆

布局:

<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/listView"/>
</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>

代码:

swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() { }
});
swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
android.R.color.holo_green_light,
android.R.color.holo_orange_light,
android.R.color.holo_red_light);

我使用 appcompat 库,ActionBarActivity

最佳答案

您必须使用修订版 21 之前的 v4 支持库 版本。此版本中的样式发生了变化。如果您使用的是 gradle,请使用如下内容:

编译 'com.android.support:support-v4:20.x.x'

其中 x 是具体的版本号。

关于android - swipeRefreshLayout appcompat 圈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27826827/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com