Inflating view above RecyclerView in FrameLayout

后端 未结 4 636
轮回少年
轮回少年 2021-01-20 10:55

On a button click, I am attempting to inflate an EditText above a RecyclerView. But instead of the EditText being added to the top of the layout, t

4条回答
  •  爱一瞬间的悲伤
    2021-01-20 11:38

    in frame layout everything stack on one another, if you want it to be above the recycler view make your layout LinearLayout and call method LinearLayout.addView(child, index) which index is 0 in your case.

    UPDATE

    because you have floating button you should make your layout something like this:

    
       
          //witch will be added later by add view
          
       
       

    also if you want the edit text to work as something like header you can use this: https://stackoverflow.com/a/26573338/2127203

提交回复
热议问题