android scrollview and scrollbar position
I have a scrollview that contain a linearlayout. I need to give little margin on the right of the scrollbar of my scrollview ,i.e scrollbar should visible inside the linearlayout not at the border.
<ScrollView
android:fillViewport="true"
android:orientation="vertical"
android:layout_width="match_parent"
android:scrollbarStyle="outsideOverlay"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbarTrackVertical="@drawable/scrollbatt开发者_JAVA百科rack"
android:scrollbarThumbVertical="@drawable/scrollbarthumb"
android:fadeScrollbars="false"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/ListView"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent">
</LinearLayout>
</ScrollView>
Experiment with the left and right margin of the LinearLayout inside the scrollview or as said in another post with the left and right padding.
find equivalent for XML:i could do it using code in this way::
ScrollView sv = new ScrollView(Activity);
LinearLayout.LayoutParams svParams = new
LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ht, 0.0F);
svParams.setMargins(1, 0, 1, 0);
精彩评论