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

查看:20
本文介绍了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.

显示:尺寸检查器上的高度"属性对于进度视图明显变灰并且无法更改 - 但是我已经在进度视图本身上定义了一个约束并将约束的高度设置为 50 点,这实际上反映在IB中.

据我所知,iOS6 Progress Bars 具有静态高度值,因此如果您还想支持 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天全站免登陆