Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making the vertical scrollbar visible

Tags:

I want to make the vertical scroll bar permanently visible. Currently the scroll bar appears only when I attempt to scroll the text view enclosed inside the scroll view. This is my XML declaration.

<ScrollView     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:layout_above="@id/radio_group"     android:layout_margin="5dp"     android:scrollbars="vertical"      android:scrollbarAlwaysDrawVerticalTrack="true" >     <TextView         android:id="@+id/question"         android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:textSize="20sp"         android:textColor="#FF000000"         android:textStyle="bold" /> </ScrollView> 

Thank you for your time.

like image 647
Ragunath Jawahar Avatar asked Jan 07 '11 17:01

Ragunath Jawahar


People also ask

How do I make the scrollbar appear?

Show scroll bars in Word and Excel for WindowsClick File > Options. On the Advanced tab, scroll to the Display section. Select Show horizontal scroll bar and Show vertical scroll bar, and then click OK.

How do I make my scrollbar visible in HTML?

Make sure overflow is set to "scroll" not "auto." With that said, in OS X Lion, overflow set to "scroll" behaves more like auto in that scrollbars will still only show when being used.

How do I keep scrollbars visible?

To always show the scrollbar, you need to enable a setting in Windows Settings. For that, press Win+I to open Windows Settings and go to Accessibility > Visual effects. Then, Toggle the Always show scrollbars button to turn it on.


2 Answers

You can set android:fadeScrollbars="false" in your ScrollView XML.

like image 103
jjb Avatar answered Sep 22 '22 07:09

jjb


We can do it in 2 different ways as shown below.

Method 1: in your XML

android:scrollbars="vertical"  android:fadeScrollbars="false" 

Method 2: in your Java Code

editText.setVerticalScrollBarEnabled(true);  editText.setVerticalscrollbarFading(false); 
like image 34
Kolla RameshReddy Avatar answered Sep 22 '22 07:09

Kolla RameshReddy