iOS 7中的进度视图高度 [英] Progress view height in iOS 7

查看:109
本文介绍了iOS 7中的进度视图高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在iOS 6及更低版本中增加进度视图的高度我使用外观方法执行此操作

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];

但现在在iOS7中这段代码无效我甚至尝试下面的代码但没有用。任何帮助都会有所帮助。谢谢

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)];


推荐答案

如果我正确理解这个问题听起来像你想要增加iOS7中进度视图的高度,以前在iOS6中使用的代码不再有效。

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.

我最近必须解决类似问题而且我通过在Interface Builder中向进度视图添加约束并通过约束显式设置高度来实现此目的。此解决方案需要使用自动布局,因此请确保已打开。

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.

显示:Size Inspector上的Height属性对于Progress View显然是灰色的,无法更改 - 但是我已经在Progress View本身上定义了一个约束并设置了约束的高度为50分,实际上反映在IB中。

从我看到的iOS6进度条有一个静态高度值,所以如果你也想支持iOS6,那么就需要采用另一种方法。

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.

这篇关于iOS 7中的进度视图高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆