他们是如何在附加的iPhone应用程序图片中使用这种按钮的?
大家好,他们是如何在附加的iPhone应用程序图片中使用这种按钮的?,iphone,objective-c,ios,cocoa-touch,Iphone,Objective C,Ios,Cocoa Touch,大家好, 我需要帮助创建一个按钮,如上图所示。 它们是用于切换到其他视图的多个按钮,以及用于显示隐藏按钮的“下一步”按钮 我想知道要使用哪个UI控件。 无论哪个免费的即用控件或代码示例是首选 多谢各位 我按照Mayur Joshi的建议做了,但不明白为什么我不能在scrollview中滚动按钮,而且按钮上没有文本 这是我的密码 - (void)viewDidLoad { [super viewDidLoad]; [scrollView setContentSize:CGS
我需要帮助创建一个按钮,如上图所示。 它们是用于切换到其他视图的多个按钮,以及用于显示隐藏按钮的“下一步”按钮 我想知道要使用哪个UI控件。
无论哪个免费的即用控件或代码示例是首选 多谢各位 我按照Mayur Joshi的建议做了,但不明白为什么我不能在scrollview中滚动按钮,而且按钮上没有文本 这是我的密码
- (void)viewDidLoad
{
[super viewDidLoad];
[scrollView setContentSize:CGSizeMake(500.0f, 50.0f)];
[self.view addSubview: scrollView];
UIButton *button1 = [UIButton buttonWithType: UIButtonTypeRoundedRect];
[button1 setTitle:@"Button1" forState:UIControlStateNormal];
[button1 setFrame:CGRectMake(0.0F, 0.0F, 100.0F, 50.0F)];
[scrollView addSubview:button1];
[button1 release];
UIButton *button2 = [UIButton buttonWithType: UIButtonTypeRoundedRect];
[button2 setTitle:@"Button2" forState:UIControlStateNormal];
[button2 setFrame:CGRectMake(100.0F, 0.0F, 100.0F, 50.0F)];
[scrollView addSubview:button2];
[button2 release];
UIButton *button3 = [UIButton buttonWithType: UIButtonTypeRoundedRect];
[button3 setTitle:@"Button3" forState:UIControlStateNormal];
[button3 setFrame:CGRectMake(200.0F, 0.0F, 100.0F, 50.0F)];
[scrollView addSubview:button3];
[button3 release];
UIButton *button4 = [UIButton buttonWithType: UIButtonTypeRoundedRect];
[button4 setTitle:@"Button4" forState:UIControlStateNormal];
[button4 setFrame:CGRectMake(300.0F, 0.0F, 100.0F, 50.0F)];
[scrollView addSubview:button4];
[button4 release];
UIButton *button5 = [UIButton buttonWithType: UIButtonTypeRoundedRect];
[button5 setTitle:@"Button5" forState:UIControlStateNormal];
[button5 setFrame:CGRectMake(400.0F, 0.0F, 100.0F, 50.0F)];
[scrollView addSubview:button5];
[button5 release];
}
这是应用程序屏幕截图。
试着用这个
我用过,而且很容易集成
虽然我没有尝试过,但您也可以尝试:
试着用这个
我用过,而且很容易集成
虽然我没有尝试过,但您也可以尝试:
从实现的角度来看,最有可能的候选对象似乎是定制的UISegmentedControl,因为一次只能激活固定装置、排行榜或最新分数中的一个 但是,如果UISegmentedControl不能定制到这种程度,那么可以通过将一系列UIButton放在一起实现。点击最右边的箭头按钮时,可以向左移动按钮,并设置此过渡的动画 嗯,
Akshay从实现角度来看,最有可能的候选对象似乎是定制的UI分段控件,因为一次只能激活一个赛程、排行榜或最新分数 但是,如果UISegmentedControl不能定制到这种程度,那么可以通过将一系列UIButton放在一起实现。点击最右边的箭头按钮时,可以向左移动按钮,并设置此过渡的动画 嗯,
Akshay只要从按钮上移除释放方法,就可以开始了 实际上,当你用
UIButton* btn1 = [UIButton buttonWithType: UIButtonTypeRoundedRect];
它已经处于自动释放模式,因为它是类方法而不是静态方法。所以你不需要写
[btn1 release];
只要从按钮上移除释放方法,就可以开始了 实际上,当你用
UIButton* btn1 = [UIButton buttonWithType: UIButtonTypeRoundedRect];
它已经处于自动释放模式,因为它是类方法而不是静态方法。所以你不需要写
[btn1 release];
这些只是添加到应用程序中的按钮UIScrollview@Mayur乔希:我同意你的建议,但我有一些问题。所以我在主要问题帖中添加了示例代码UIScrollview@Mayur乔希:我同意你的建议,但我有一些问题。所以我在主要问题帖中添加了示例代码。