-1

Below is the item of layout i am using in listview.The issue is that when i make visibility of countlayout gone in some items of list I expect vibelayout to be exactly at same place where countlayout was since weigtSum is 3.But it is appearing slightly right of position where countlayout was.

I am using View.GONE so that countlayout space is assigned to vibelayout but its not happening.. vibelayout is appearing slightly right of position where countlayout was.

Android Developer
  • 9,157
  • 18
  • 82
  • 139

1 Answers1

1

Try using android:layout_width="0dp" in all 3 layouts. It will solve your problem

Ravi
  • 34,851
  • 21
  • 122
  • 183
  • i know that..but my requirement is is that vibelayout shoud appear in place of countlayout when countlayout is not required..check the layout.. – Android Developer Jun 23 '16 at 11:14
  • I am using View.GONE so that countlayout space is assigned to vibelayout but its not happening.. vibelayout is appearing slightly right of position where countlayout was. – Android Developer Jun 23 '16 at 11:15
  • `0dp` will occupy same space for all layouts, if you will use `wrap_content` it will take width as per content in layout. – Ravi Jun 23 '16 at 11:19