-2

UPDATE: NO, NO, NO - It's not a repeat of the question above. Thanks for the down votes but this question is about EVERY item being cut off. Sorry if this was not clear.

I have RecyclerView.Adapter and Recycler View.

    return new MyViewHolder(v);


The problem is the last element in the item layout gets cut off for EVERY item. Only half of the rating bar stars are visible so I wanted to increase the height of of the item. The Item layout is shown below"

      <FrameLayout
          height=wrap_content
         ....
       <RelativeLayout
          height=match-parent
          <ImageView
              width=100dp
              height=100dp
              centerVertical=true >
          <TextView
               id=tv1
               toTheEndOf="imageId"
               toTheRightOf="imageId"
              >
          <TextView
               id=tv2
               below="tv1"
               toStartOf="tv1"
               >
          <TextView
               id=tv3
               below=tv2"
          <TextView id=tv4
              below=tv3
          <RatingBar        // After adding tv3 only half of rating bar is shown?
               below=tv4
               height=wrap-content/>
      <RelativeLayout>
  </FrameLayout>

UPDATE: Switching the RelativeLayout to wrap_content results in everything shown but now tv2 appears sometimes over tv2 and sometimes above it but too close.

gitsensible
  • 551
  • 1
  • 8
  • 19
  • Possible duplicate of [RecyclerView is cutting off the last item](https://stackoverflow.com/questions/32742724/recyclerview-is-cutting-off-the-last-item) – marmor May 28 '17 at 14:13
  • No @marmor its not a duplicate because it's not the last item in the list it's the last element in the item for every item. – gitsensible May 28 '17 at 17:22

1 Answers1

0

Try use

height = wrap-content

or

height=fill-parent

on your Relative Layout. Also, try use fixed h eight on the children. ie:

height: 30dp

cesarsicas
  • 437
  • 1
  • 5
  • 17
  • thanks. The change to wrap-content shows everything but now the top TextView slides 2nd textView slides over the one just below it. – gitsensible May 29 '17 at 03:43
  • send us some screenshot to better understand – cesarsicas May 29 '17 at 12:09
  • sorry I cannot share. But actually I think it's working now. with relative layout having match_parent and frame having wrap_content. I have another issue however. Here is my other issue:https://stackoverflow.com/questions/44243141/textview-detect-if-string-exceeds-available-space – gitsensible May 29 '17 at 13:05