http://www.cocoachina.com/ios/20150611/12082.html最近在使用UIButton的过程中遇到一个问题,我想要获得手指拖动button并离开button边界时的回调,于是监听UIControlEventTouchDragExit事件,如文档所述:1Aneve...
分类:
其他好文 时间:
2015-06-12 06:30:11
阅读次数:
122
- (IBAction)StartDownLoad:(UIButton *)sender { //NSString *urlstr = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; NSStrin...
分类:
Web程序 时间:
2015-06-11 16:51:43
阅读次数:
99
- (IBAction)login:(UIButton *)sender { NSString *username = self.usrnameTextField.text; NSString *password = self.pwdTextField.text; NSString *u...
分类:
Web程序 时间:
2015-06-11 16:23:13
阅读次数:
127
- (IBAction)getbigfile:(UIButton *)sender { NSString *str = @"http://b.hiphotos.baidu.com/video/pic/item/e850352ac65c1038698cd94eb7119313b17e894f.j...
分类:
其他好文 时间:
2015-06-11 12:39:14
阅读次数:
113
UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom]; btn.tag = 100; NSLog(@"%d",btn.tag); objc_setAssociatedObject(self, &o...
分类:
其他好文 时间:
2015-06-10 18:56:16
阅读次数:
109
UIButton是一个标准的UIControl控件一、创建两种方法:1. 常规的 initWithFrame(基本不用)UIButton *btn1 = [[UIButton alloc]initWithFrame:CGRectMake(10, 10, 80, 44)];对代码创建View(UICo...
分类:
其他好文 时间:
2015-06-10 15:36:05
阅读次数:
216
效果图首先,使用for循环将视图在模拟器上创建出来 for(NSInteger i = 0; i < 6; i++) {for (NSInteger j = 0; j < 10; j++) {//创建和灯泡视图等同数量的button, 来控制灯泡的开关UIButton *lightButton = ...
分类:
其他好文 时间:
2015-06-10 13:45:22
阅读次数:
88
不多说,上代码- (void)viewDidLoad { [super viewDidLoad]; [self creatUI];}-(void)creatUI{ UIButton* add = [UIButton buttonWithType:UIButtonTypeRoundedRect]...
分类:
其他好文 时间:
2015-06-10 10:26:07
阅读次数:
108
一。自定义navigationbar
- (void)initNavigationBar{
[self.navigationController setNavigationBarHidden:YES];
UINavigationBar *bar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, ...
分类:
移动开发 时间:
2015-06-10 08:58:53
阅读次数:
229
一、创建
两种方法:
1. 常规的 initWithFrame
源码打印?
UIButton *btn1 = [[UIButton alloc]initWithFrame:CGRectMake(10, 10, 80, 44)];
对代码创建View(UIControl继承自UIView,所以也是view)不甚了解的请参看: 《有关View的...
分类:
移动开发 时间:
2015-06-10 08:56:21
阅读次数:
178