ScrollView Color

Thread is closed for posting
3 posts, 0 answers
  1. Hugo
    Hugo avatar
    28 posts
    Member since:
    May 2011

    Posted 20 Apr 2015 Link to this post

    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. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 21 Apr 2015 Link to this post

    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.

     
  3. Hugo
    Hugo avatar
    28 posts
    Member since:
    May 2011

    Posted 24 Apr 2015 in reply to Rossen Hristov Link to this post

    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?

Back to Top