Android Question How to Center DilatingDotsProgressbar

ronell

Well-Known Member
Licensed User
Longtime User
can you post the relevant code? without it we cannot help to solve the problem
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
You can calculate the Left property like this:
B4X:
Private Width As Int
Width = (DotRadius * 2 + DotsSpacing) * NumberOfDots - DotsSpacing
dots.Left = (100%x - Width) / 2
Unfortunately the Width property returned by the library is the width from the Designer and not the real width.
And DotRadius, DotsSpacing and NumberOfDots are write only so you need to enter your values or define variables for them.
You should use dip values for DotRadius and DotsSpacing and not pixel values!
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…