ios - How to change UIScrollView Indicator color? -


when use uicolor.blue changing, when try apply rgb, not reflected in scrollview indicator.

func scrollviewdidscroll(_ scrollview: uiscrollview) {     let verticalindicator: uiimageview = (scrollview.subviews[(scrollview.subviews.count - 1)] as! uiimageview)     verticalindicator.backgroundcolor = uicolor(red: 211/255, green: 138/255, blue: 252/255, alpha: 1) //        verticalindicator.backgroundcolor = uicolor.blue  } 

i think problem here

verticalindicator.backgroundcolor = uicolor(red: 211/255, green: 138/255, blue: 252/255, alpha: 1) 

change

verticalindicator.backgroundcolor = uicolor(red: 211/255.0, green: 138/255.0, blue: 252/255.0, alpha: 1). 

the result of division 211/255 type of integer return 0 or 1 (in case think 0).


Comments

Popular posts from this blog

c# SetCompatibleTextRenderingDefault must be called before the first -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -

c++ - Fill runtime data at compile time with templates -