- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我尝试在我的应用中实现下拉刷新。
我用 android.support.v4.widget.SwipeRefreshLayout 包装了我的 xml 代码,它可以正常工作,但 GUI 看起来不太好。
当我下拉时,我应该看到带有我定义的颜色的常规动画圆圈图标,对吗?但我看到它是一个空白圆圈,而不是一个带有颜色的旋转圆圈。
此外,我无法“玩”它,甚至在我拉动它后保持一会儿,它会下降一秒钟(做它做的)然后消失。
我认为这是因为我没有使用 ListView,而是使用了 LinearLayout。
你怎么看?
XML:
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/swipe">
<LinearLayout
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:orientation="vertical"
android:layout_width="match_parent"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="#7B68EE"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".HomeActivity">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/loin"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/welcome"
android:textColor="#B0C4DE"
android:id="@+id/welcomeBackID"
android:layout_alignParentTop="true"
android:layout_alignRight="@+id/webViewCurren"
android:layout_alignEnd="@+id/webViewCurren" />
....
</android.support.v4.widget.SwipeRefreshLayout>
Java:
public class HomeActivity extends AppCompatActivity implements SwipeRefreshLayout.OnRefreshListener {
SwipeRefreshLayout mSwipeRefreshLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe);
mSwipeRefreshLayout.setColorSchemeResources(android.R.color.holo_green_light,
android.R.color.holo_blue_bright,
android.R.color.holo_orange_light,
android.R.color.holo_red_light);
mSwipeRefreshLayout.setOnRefreshListener(this);
@Override
public void onRefresh() {
Toast.makeText(this, "Refresh", Toast.LENGTH_SHORT).show();
sharedPrefEditor.putString("coordinateX", "34.7");
sharedPrefEditor.putString("coordinateY", "32.5");
sharedPrefEditor.putString("saved", "false");
sharedPrefEditor.commit();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mSwipeRefreshLayout.setRefreshing(false);
}
}, 3000);
}
}
最佳答案
尝试更改 SwipeRefreshLayout
配色方案。
swipeRefreshLayout.setColorSchemeColors(
Color.RED, Color.GREEN, Color.BLUE, Color.CYAN);
此外,SwipeRefreshLayout
仅在 onRefresh()
完成执行之前可见。
关于android - 我可以在不使用 ScrollView/ListView 的情况下使用 Pull to Refresh 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32156711/
有没有办法 git pull 直到有东西可以 pull 。 假设我正在等待一位同事推送他的最新更改,因为我不耐烦并且没有看他的屏幕,我只是运行 watch git pull 直到我看到有东西被 pul
这个问题在这里已经有了答案: What is the difference between 'git pull' and 'git fetch'? (37 个答案) 关闭 6 年前。 这个问题我一直
我有一个分支,想使用 $ git pull origin master 将 master 中的更改 git在我这样做之后, pull 确实没有显示任何 merge 的 PR 被 pull 并且说它已经
在各个地方,寻找有关如何从 GitHub merge 请求创建本地分支的说明,我看到了两个版本: git fetch upstream refs/pull/PR_ID/head:NEW_LOCAL_B
我已经在github上创建了一个仓库。 Upstream中有一些新的 pull 请求。我想从本地上游 pull 请求。 我怎样才能做到这一点?我不知道,没有发现任何与此相关的信息。 最佳答案 通过首先
假设我 fork 一个 GitHub 项目并进行一些更改,然后为要 merge 到的更改创建 pull 请求我从中 fork 的原始项目。 一旦我这样做了,如果我返回到我的 fork 项目并提交更多文
我在 BitBucket 上有一个 Git 存储库。我有两个分支 master 和 db。在我的笔记本电脑上,我对 db 进行了更改,提交了更改并推送到 BitBucket。我可以在该分支中看到提交。
我在分支 tm-skeleton并执行 git pull 做某事(从技术上讲,它要求输入密码,然后我在那里点击了 ),但我怎么知道它从哪里 pull ?通常,[branch "tm-skeleton"
我们在组织中使用 Github 进行源代码控制。多个开发人员不断地将他们的更改 merge 到远程源存储库。就我而言,我在两周前克隆了存储库,之后进行了多次 merge 。现在我正在尝试获取代码的最新
在 merge pull 请求之前,我想在本地快速 pull 请求并运行测试并测试一些内容。我还不想点击 gihub merge pull 请求。 我认为滑轮会有所帮助 http://ejohn.or
我有一个服务器,其中有一些我不知道我在哪里的配置我只是 git pull 并获取 github 存储库中的内容,然后重新启动它以进行部署。 问题是,有一个不是我最新的提交,它实际上不在我的服务器上。这
我是 Git 的新手,所以如果这是微不足道的,我深表歉意。我有一个使用 Github 和 EGit 设置的私有(private)存储库. 要更新并 merge 我的本地存储库分支与远程版本(本质上是g
pull 请求的发起者可能 give the maintainer the ability to edit the pull request . 对于任何给定的 pull 请求,我们如何判断该能力是否
我 fork 了一个GitHub存储库,并在 fork 上进行了一些更改,然后提交了一个 pull 请求,但是原始GitHub存储库的所有者要求对它们进行 pull 请求中的一些更改。我以为在fork
如何使用 Git GUI 工具进行拉取?似乎任何地方都没有 pull 命令。 是否有使用 Git GUI 的等效菜单选项? 任何帮助将不胜感激。 最佳答案 嗯,我发现这个有用的论坛帖子: https:
我制作了一个程序来从我的 github 上托管的公共(public)存储库中提取数据。克隆一个项目工作得很好(无论如何我都是这样做的),但我一直在努力让它工作以提取所有内容,一旦你删除一个文件,它不再
哪个比另一个更可取,为什么?如果我在提交之前 pull ,其他开发人员所做的更改是否与我当前正在处理的内容 merge ?如果是这样,那意味着这个更可取? 最佳答案 最好先提交。 pull 而不提交可
我对使用 git 在团队中工作还很陌生。 我从“origin/master”开始。 首先我创建了一个新分支feature/26062018-offline-seite_ef。 我添加了提交。 我检查了
这个问题在这里已经有了答案: Retrieve specific commit from a remote Git repository (11 个答案) 关闭 9 年前。 我在本地创建一个空的新存
我开始在 Github 上使用新的 pull 请求草案功能,但我想知道在我不小心发出 pull 请求的情况下是否可以将合法的 pull 请求转换回 pull 请求草案。 最佳答案 如前所述on Twi
我是一名优秀的程序员,十分优秀!