我SwipeRefreshLayout
在活动中显示的片段中使用了一个.刷卡确实执行了刷新,但是在我向下拉后它向右上升并且没有不确定进度的指示(动画进度条).它刚刚消失,但在完成后仍然会调用onRefresh().这是我的布局......
活动布局:
片段布局:
用于初始化Fragment
布局的代码:
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_list, null); swipeLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipe_container); swipeLayout.setOnRefreshListener(this); swipeLayout.setColorScheme(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light); return view; }
刷新时通常会有3到6秒的延迟,足以让他在观看日志时显而易见.它应该是可见的,当我使用现已弃用的ActionBar-PullToRefresh
库时它工作正常.我已经尝试制作SwipeRefreshLayout
片段布局的根视图,我尝试删除空文本和进度视图,但它仍然无法正常工作.
我的实际代码中还有一些步骤,我无法透露,因为它是为我的公司设计的应用程序.但它只是为许多不同的片段提供类似的基础来做类似的事情,它不应该影响任何功能.