Search code examples
iosios6ios7progress

ios progressbar height different between ios7 and ios6


By default, progressBar have a different height in Ios7 and Ios6.

to set the height of my progressBar I use the following code :

CGAffineTransform transform = CGAffineTransformMakeScale(1.0f, 2.0f);
self.myProgressbar.transform = transform;

but it's only work on ios6. in ios7, the progressBar still have the default height.

How can I set the same height for both ios 6 and 7 ?

thanks for your help.


Solution

  • code that work's for me, thanks for help

    - (BOOL)isDeviceVersion:(NSString *)version
    {
        return ([[[UIDevice currentDevice] systemVersion] compare:version  options:NSNumericSearch] == NSOrderedSame);
    }
    
    
    -(void) viewWillLayoutSubviews
    {
        if ([self isDeviceVersion:@"7.0"])
        {
            CGAffineTransform transform = CGAffineTransformMakeScale(1.0f, 25.0f);
            self.myProgressbar.transform = transform;
        }else{
            CGAffineTransform transform = CGAffineTransformMakeScale(1.0f, 2.0f);
            self.myProgressbar.transform = transform;
        }
    
    }