1

Container is a RelativeLayout, inside there is a ListView with padding. Red area is padded and covered with a frame-like image.

So the problem is, ScrollBar only shows up when the items in the ListViews total height is taller than the RelativeLayout, not the padded ListView. Though it scrolls properly when the ListViews height is shorter than the RelativeLayout within the boundries of ListView without showing the scrollBars.

Do you have any idea how I can persuade Android that it is really worth showing the scrollbar?

Edit: I have to add: There is another identical ListView , next to this one in the RelativeLayout. I simplified the code for readibility.

  <RelativeLayout
    android:id="@+id/audiosubtitleview"
    android:layout_width="150dp"
    android:layout_height="95dp"
    android:layout_above="@id/bottomcontrol"
    android:layout_alignParentRight="true"
    android:visibility="visible" >

    <ListView
        android:id="@+id/audiolist"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:background="@drawable/play_audio_subtitle_bg"
        android:cacheColorHint="#00000000"
        android:divider="@color/list_divider"
        android:dividerHeight="1dp"
        android:paddingTop="8dp"
        android:paddingBottom="10dp"
        android:paddingLeft="10dp"
        android:paddingRight="13dp"
        android:overScrollMode="never"
        android:visibility="gone" />
 </RelativeLayout>
Alpaslan
  • 233
  • 1
  • 2
  • 11

1 Answers1

0

You should use a padding on your RelativeLayout instead of padding on your ListView

anonymos
  • 167
  • 2
  • 14
  • Simply can't. This way my frame image is also margined, which is not acceptable. – Alpaslan Jul 03 '15 at 11:35
  • Ok, just to clarify; the red Area is your RelativeLayout, while the white is your ListView? If not, could you please post your entire xml file? – anonymos Jul 03 '15 at 11:40
  • The entire rectangle is RelativeLayout and the inner white rectangle is the ListView with paddings to RelativeLayout. The code I pasted is clearly shows the perpective I guess. – Alpaslan Jul 03 '15 at 11:44
  • No it does not. I can't change the margin of the RelativeLayout. It needs to stay in its place. – Alpaslan Jul 03 '15 at 13:09
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/82308/discussion-between-alpaslan-and-hr-frosk). – Alpaslan Jul 03 '15 at 14:04
  • Sorry, small mistake; meant padding, not margin. My mistake. It should definitely work now. See updated answer – anonymos Jul 03 '15 at 14:18
  • I might have misunderstood your question, in that case it might help you to add a margin to all of the elements in your listview instead of putting a padding on the listview itself – anonymos Jul 03 '15 at 16:17