0

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/scrollbattrack"
    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>

2 Answers 2

0

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.

0

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);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.