Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to increase the height of progress view in iOS 6 and below i am doing this using appearence method

  UIImage *progressImage = [[UIImage imageNamed:@"sliderbk-progress.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 4, 0, 5)];
[[UIProgressView appearance] setProgressImage:progressImage];

but now in iOS7 this code is not working i even try given below code but no use. Any help will be helpfull. Thanks

[[UIProgressView appearance] setFrame:CGRectMake(20, 100, 280, 100)];
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
408 views
Welcome To Ask or Share your Answers For Others

1 Answer

If I am understanding the question correctly it sounds like you want to increase the height of the progress view in iOS7, and the code you used previously in iOS6 is no longer working.

I had to solve a similar problem recently and I did this by adding a constraint to the progress view in Interface Builder and setting the height explicitly through the constraint. This solution will require the use of Auto-Layout, so be sure that you have that turned on.

height attribute

Shown: the "Height" attribute on the Size Inspector is visibly greyed out for a Progress View and cannot be changed - however I've defined a constraint on the Progress View itself and set the constraint's height to 50 points, which is actually reflected in IB.

From what I've seen iOS6 Progress Bars have a static height value, so if you also want to support iOS6 then another approach will be necessary for that.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...