0

I'm trying to do a Widget with a ListView, but I want to show the ScrollBar really in the right side, without any padding.

I want it like the gmail calendar Widget. I will show you how with pictures: enter image description here

This is my Layout:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical">
    <FrameLayout android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <TextView
            android:layout_width="match_parent"
            android:id="@+id/widgetTitle"
            android:textColor="@color/colorWhite"
            android:background="@drawable/widget_title_background"
            android:textSize="15dp"
            android:gravity="center"
            android:layout_height="@dimen/widget_title_min_height"></TextView>
    </FrameLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:padding="0dp"
        android:background="@color/colorWhite">
        <ListView
            android:id="@+id/widgetListView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"    
            android:padding="0dp"
            android:clipToPadding="false"
            android:scrollbarStyle="outsideOverlay"
            tools:listitem="@layout/widget_list_item"></ListView>
    </LinearLayout>
</LinearLayout>
Slashhh
  • 154
  • 1
  • 12

1 Answers1

0

In Listview control scrollbar default show on right side always. Try This code ..

   <ListView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/listview"></ListView>
  • Yep, on right side, but with a little padding between the scrollbar and the border of the widget. I will edit the post. – Slashhh Apr 24 '18 at 14:50