无法调整iOS 5.0中的活动指示器大小? [英] Could not resize the activity indicator in iOS 5.0?

查看:158
本文介绍了无法调整iOS 5.0中的活动指示器大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的通用应用程序中,在iPAd部分中,我正在调整活动指示器的大小...



我想调整活动指示器的大小。



但真的有iOS问题
首先是我的代码...

   - (void)startSpinner {

spinner = [[UIActivityIndi​​catorView alloc] initWithActivityIndi​​catorStyle:UIActivityIndi​​catorViewStyleWhiteLarge];



/ * spinner = [[UIActivityIndi​​catorView alloc] initWithActivityIndi​​catorStyle:UIActivityIndi​​catorViewStyleGray] * /
spinner.hidden = NO;


NSLog(@Start Spinner);

if([self isPad])
spinner.frame = CGRectMake(self.view.frame.size.width / 2,self.view.frame.size.height / 2,100,100 );
else
spinner.frame = CGRectMake(self.view.frame.size.width / 2,self.view.frame.size.height / 2,50,50);



NSLog(@Dpinner size%f,spinner.frame.size.width);

[spinner setHidesWhenStopped:YES];


[self.view addSubview:spinner];
[self.view bringSubviewToFront:spinner];
/ * 1 * / ** [spinner setColor:[UIColor blackColor]]; **
[spinner startAnimating];

}

问题1:


b $ b

iOS 5.0:它显示我活动指示器,但无法调整它的大小。
isPAd方法中的大小不变。



iOS 4.3:
在更改颜色时给出信号中止错误。 / 1 /加粗线在代码中设置颜色。
这里如果我在 WhiteLargeStyle 中删除iOS 5.0中的setColor它不显示在白色背景中。



这里如果我使用灰色等活动指示器样式,它在iPAd.works中绝对小,但无法调整大小。



在iOS 4.3框架获取效果,但iOS5框架无效...



所以,我应该如何调整活动指示器的大小。

解决方案

考虑使用自定义进度指示器,因为它将给予更多的灵活性。



我使用 MBProgressHUD ,它对我来说很简单和伟大。



您可以在这里取得 -
https: //github.com/jdg/MBProgressHUD


In my Universal app, in iPAd part I am resizing the activity indicator...

I want to resize my activity indicator..

But there are really iOS problems first here is my code...

-(void)startSpinner {

    spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];



/*spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; */    
        spinner.hidden = NO;


    NSLog(@"Start Spinner");   

    if([self isPad])
 spinner.frame = CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height/2,100, 100);
else
 spinner.frame = CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height/2,50, 50);



     NSLog(@"Dpinner size %f",spinner.frame.size.width);

        [spinner setHidesWhenStopped:YES];


           [self.view addSubview:spinner];
                [self.view bringSubviewToFront:spinner];
        /*1*/       **[spinner setColor:[UIColor blackColor]];**
                [spinner startAnimating];

        }

Problem 1:

iOS 5.0 : It is showing me activity indicator but could not resize it. Size is not changing in isPAd Method.

iOS 4.3 : It is giving me Signal Abort Error on changing the color. /1/Bolded Line in code to set color. Here If I remove setColor in iOS 5.0 in WhiteLargeStyle it is not showing me in White background.

Here If I use Activity Indicator style like gray it is absolutely small in iPAd.works but could not resize.

In iOS 4.3 frame get effects but ios 5.0 frames are not effective...

So, How should I resize the activity indicator...

解决方案

Consider using custom progress indicators as it will give more flexibility.

I am using MBProgressHUD and it's simple and great for me.

You can get it here - https://github.com/jdg/MBProgressHUD

这篇关于无法调整iOS 5.0中的活动指示器大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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