小编Yea*_*000的帖子

自定义左右UISegmentedControl按钮

我正在尝试自定义以下分段控件,第一个按钮使用左图像,第二个按钮使用右图像.我怎么用UIAppearance做到这一点?

我想更改以下segmentedControl:

在此输入图像描述

类似下面的东西:

在此输入图像描述

我想使用自定义图像的原因是我可以更改按钮的角落.如果你看一下蓝色分段控制,它会更加平方(我的图像有它自己的角落).

我在考虑这样的事情,但没有用:

UIImage *leftImage = [[UIImage imageNamed:@"leftControl.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)];
UIImage *rightImage = [[UIImage imageNamed:@"rightControl.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)];

[[UISegmentedControl appearance] setBackgroundImage:leftImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault ];
[[UISegmentedControl appearance] setBackgroundImage:rightImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
Run Code Online (Sandbox Code Playgroud)

iphone uisegmentedcontrol ios ios5 uiappearance

26
推荐指数
2
解决办法
2万
查看次数

在UIImageView向上和向下(就像它的悬停)循环中动画UIImage

你好,我有一个图像,我想上下移动(向上10像素,向下10像素),以便我的图像看起来像是在盘旋.我怎么能用简单的动画做到这一点非常感谢!!!

animation core-animation uiimageview ios ios6

9
推荐指数
3
解决办法
6770
查看次数

我正在尝试使用MWFeedParser显示MBProgressHUD的进度

您好,我一直在尝试使用环形定标显示最后一个小时的进度,但我似乎无法使其按照自己的意愿进行。它要么在我的表视图加载内容之前消失,要么从不完全加载到进度栏。

在我的viewDidLoad方法中,我开始像这样运行MWFeedParser时显示它:

- (void)viewDidLoad {

[super viewDidLoad];

// Parse
NSURL *feedURL = [NSURL URLWithString:@"http://myurl.com"];
feedParser = [[MWFeedParser alloc] initWithFeedURL:feedURL];
feedParser.delegate = self;
feedParser.feedParseType = ParseTypeFull; // Parse feed info and all items
feedParser.connectionType = ConnectionTypeAsynchronously;
[feedParser parse];

// Display HUD
[super viewDidLoad];

HUD = [[MBProgressHUD alloc] initWithView:self.view];
HUD.labelText = @"Loading";
HUD.detailsLabelText = @"Just relax";
HUD.mode = MBProgressHUDModeAnnularDeterminate;
[self.view addSubview:HUD];

[HUD showWhileExecuting:@selector(feedParserDidStart:) onTarget:self withObject:nil animated:YES];

}
Run Code Online (Sandbox Code Playgroud)

在调用解析器之后,它会通过5个不同的步骤运行,我想在这些步骤中更新HUD,但似乎无法做到这一点。下一步是这些:

- (void)feedParserDidStart:(MWFeedParser *)parser {
NSLog(@"Started Parsing: %@", parser.url);

float stepsDone = 0.20;    
HUD.progress = …
Run Code Online (Sandbox Code Playgroud)

iphone ios mbprogresshud ios5 progress-bar

1
推荐指数
1
解决办法
1万
查看次数