This is a migrated thread and some comments may be shown as answers.

ScrollView Color

2 Answers 78 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Hugo
Top achievements
Rank 1
Hugo asked on 20 Apr 2015, 04:53 PM

Is possible change the color and alignment of scrollBar thumb?

 

I try this but not work:

if (scrollView.android) {
        scrollView.android.setScrollBarFadeDuration(0);

        var colorsArray = java.lang.reflect.Array.newInstance(java.lang.Integer.class.getField("TYPE").get(null), 3);
        colorsArray[0] = android.graphics.Color.parseColor("#20c7d6");
        colorsArray[1] = android.graphics.Color.parseColor("#0a2742");
        colorsArray[2] = android.graphics.Color.parseColor("#0a2742");

        var g = new android.graphics.drawable.GradientDrawable(android.graphics.drawable.GradientDrawable.Orientation.TL_BR, colorsArray);
        g.setGradientType(android.graphics.drawable.GradientDrawable.LINEAR_GRADIENT);
        scrollView.android.scrollbarThumbHorizontal = g;
    }

2 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 21 Apr 2015, 06:41 AM
Hi,

Can you try the same code in a native Android application project (i.e. no NativeScript, pure Java) and see whether it works there?

Regards,
Rossen Hristov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Hugo
Top achievements
Rank 1
answered on 24 Apr 2015, 02:09 PM

Hi,

My code on native android not works, but in there exist one example: http://stackoverflow.com/questions/20782499/how-can-i-change-the-width-thickness-of-a-scrollbar

 

Is possible do this in nativescript?

Tags
General Discussions
Asked by
Hugo
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Hugo
Top achievements
Rank 1
Share this question
or