我正在尝试使用 ListView 做一个小部件,但我想在右侧真正显示 ScrollBar,没有任何填充。
我希望它像 gmail 日历小部件一样。我将向您展示如何使用图片:
这是我的布局:
<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>