Display posts in descending posted order

前端 未结 18 881
南方客
南方客 2020-11-22 11:47

I\'m trying to test out Firebase to allow users to post comments using push. I want to display the data I retrieve with the following;

fbl.child         


        
18条回答
  •  有刺的猬
    2020-11-22 12:07

    There is really no way but seems we have the recyclerview we can have this

     query=mCommentsReference.orderByChild("date_added");
            query.keepSynced(true);
    
            // Initialize Views
            mRecyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
            mManager = new LinearLayoutManager(getContext());
    //        mManager.setReverseLayout(false);
            mManager.setReverseLayout(true);
            mManager.setStackFromEnd(true);
    
            mRecyclerView.setHasFixedSize(true);
            mRecyclerView.setLayoutManager(mManager);
    

提交回复
热议问题