-1
A
回答
2
还有的UIButton的属性命名showsTouchWhenHighlighted: 您可以通过代码试试这个。如果您将该属性设置为YES,则当您触摸该按钮时,它会显示发光。它的默认值是NO。
[yourButton setShowsTouchWhenHighlighted:YES];
0
你要做的是设置突出显示的图像。例如:
[someButton setImage:[UIImage imageNamed:@"MyHighlight.png"]
forState:UIControlStateHighlighted];
然后当用户点击它时,您的MyHighlight.png
将显示。
0
toolbar = [UIToolbar new];
toolbar.barStyle = UIBarStyleDefault;
[toolbar sizeToFit];
toolbar.frame = CGRectMake(0, 410, 320, 50);
//Add buttons
UIBarButtonItem *systemItem1 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(pressButton1:)];
UIBarButtonItem *systemItem2 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction
target:self
action:@selector(pressButton2:)];
UIBarButtonItem *systemItem3 = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemCamera
target:self action:@selector(pressButton3:)];
//Use this to put space in between your toolbox buttons
UIBarButtonItem *flexItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil
action:nil];
//Add buttons to the array
NSArray *items = [NSArray arrayWithObjects: systemItem1, flexItem, systemItem2, flexItem, systemItem3, nil];
//release buttons
[systemItem1 release];
[systemItem2 release];
[systemItem3 release];
[flexItem release];
//add array of buttons to toolbar
[toolbar setItems:items animated:NO];
[self.view addSubview:toolbar];
用这个来创建toolBar。
,如果你想更改按钮图像,当你点击按钮,现在设置不同的图像,两者的默认,并强调统计用这个搜索按钮
UIBarButtonSystemItemSearch
0
。正如:
[tempButton setImage:[UIImage imageNamed:@"NormalImage.png"]
forState:UIControlStateNormal];
[tempButton setImage:[UIImage imageNamed:@"HighlightImage.png"]
forState:UIControlStateHighlighted];
如果你想在同一图像的闪光效果,被点击按钮时, 在你的厦门国际银行,转到Inspector窗口>控制>检查突出显示的属性。
[tempButton setShowsTouchWhenHighlighted:YES];
//or
tempButton.highlighted = YES;
相关问题
- 1. 在动画视图时动画UIButton
- 2. iPhone UIView动画禁用UIButton子视图
- 3. 动画UIButton图层?
- 4. 动画UIButton背景图像
- 5. uibutton动画
- 6. UIbutton flashing动画
- 7. 动画UIButton
- 8. UIButton的动画
- 9. UIButton移动动画
- 10. 用UIImageView子视图显示动画图像的UIButton
- 11. 动画视图
- 12. UIButton周转动画
- 13. 动画选择UIButton
- 14. UIButton心跳动画
- 15. UIButton上的动画
- 16. UIButton上的动画
- 17. UIButton不能在动画子视图上工作
- 18. 带动画gif的IOS UIButton图像
- 19. 带动画的UIButton图像按钮
- 20. 带动画图像的UIButton不显示
- 21. 滚动视图的UIbutton不互动
- 22. 动画子视图
- 23. iOS视图动画
- 24. 动画视图WPF
- 25. UISplitViewController,动画视图
- 26. OnclickListener动画视图
- 27. UIView - 动画视图
- 28. 表视图动画
- 29. iPhone视图移动动画
- 30. 动画和移动视图