单选UIbutton的实现
来源:互联网 发布:英文写作软件 编辑:程序博客网 时间:2024/05/22 01:40
.h文件:
#import <UIKit/UIKit.h>
@interface ViewController :UIViewController{
UIButton *sourceBt;
}
@property(nonatomic,retain)IBOutletUIButton *sourceBt;
-(IBAction)select:(id)sender;
@end
.m文件
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[superviewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[superdidReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(IBAction)select:(id)sender
{
if (self.sourceBt)
{
self.sourceBt.selected =NO;
self.sourceBt.backgroundColor=[UIColorwhiteColor];
}
UIButton * bt = (UIButton *)sender;
bt.selected =YES;
bt.backgroundColor=[UIColorredColor];
self.sourceBt = bt;
NSLog(@"%d",bt.tag); //获取选择的btn的tag值
}
@end
- 单选UIbutton的实现
- uibutton的单选和多选
- iOS的UIButton单选的最佳方式
- UIButton 的实现原理
- UIbutton的倒计时实现
- iOS自定义UIButton的实现
- IOS UIbutton的长按事件实现
- UIButton 长按消息的实现
- UIbutton实现打地鼠的小游戏
- UIButton的实现(含有边框)
- UIButton 点击传递两个参数的实现
- UIButton控件的创建与功能实现
- 单选按钮的实现
- UICollectionView 单选的实现
- jQuery实现radio的单选,和取消单选
- UIButton实现背景拉伸
- iOS 实现UIButton加小红点
- IOS的UIButton单状态,圆角,边框,去除按下时的状态。
- 接下来安排
- Union
- 编译libcurl
- 输入内容的有效性
- 安卓实现所有activity全部销毁
- 单选UIbutton的实现
- [leetcode 3] Longest Substring Without Repeating Characters
- 发现一个设置tableview位置的问题
- PCM 数据中的大/小端 与 MSB/LSB
- 20140702
- jQuery遍历
- 基于.NET的Excel开发:单元格区域的操作(读取、赋值、边框和格式)
- Webapp的时代已经到来
- 进入社会大学了