I would like to increase the height of the iosProgressbar control, but its read only in the IDE. After some research I have seen some solutions, but i cant implement them in xojo. Can a declare guru help me out?
I tried to use layout constraints, but there is no option to set height for the control.
Solution in xcode: CGAffineTransform transform = CGAffineTransformMakeScale(1.0f, 3.0f);
progressView.transform = transform;
You can create your own using a Canvas.
Even in Xcode progress bars are a fixed height
This is “normal” iOS UI
As Norman mentioned this will likely look weird in your UI since it is different than the user expects, however here is a simple project with the necessary declares.
[quote=286593:@Norman Palardy]Even in Xcode progress bars are a fixed height
This is “normal” iOS UI[/quote]
while this is true, as it is with other controls (UISwitch for example), the use of CGAffineTransform is fairly common for the Progressbar since its “official” height is only 2 or 3 pixels (whos’ idea was that?)
However, for the record, be aware that CGAffineTransform does NOT work on some UIKit controls, such as UISwitch and UIStepper, the frame will change, but the control visiual itself will not, I ran across this (and a few other strange things), when writting a “autoscale” class for Swift (similar to Rubberview)
Thank you for the answers.
I tried, but for some reason its not refreshing. I read values from json and insert it into a database with a loop and use this loop variable and a timer (100 ms) to increase the width of a rectangle on a canvas.
Important : it won’t update from within the same event/method, so a simple loop won’t do. The UI won’t update until the end of the event. The best way is to use a timer for your loop, so the UI will be updated at every cycle. Note that you would have the same issue with a built-in ProgressBar.
Example of timer loop :
To use a timer for a loop, make
i as Integer a property of the view, add a property for the bound of the loop, like for instance
iMax as Integer, make the timer with a period of 1 or zero, off in the IDE.
To start the loop :
i = 0
iMax = 10
TimerLoop.Mode = Timer.ModeMultiple
In TimerLoop Action :
if i <= iMax then
//Do what you need to do in the loop
'Invalidate the Canvas
i = i + 1 // or any other step increment needed. You can also make iStep a property of the view
elseIf i > iMax then
me.Mode = Timer.ModeOff