IOS中UIButton控件的应用


UIButton *Button_Login = [UIButton buttonWithType:UIButtonTypeRoundedRect];         //边框设置
    Button_Login.frame = CGRectMake(143, 50, 40, 30);                                   //位置及大小
    Button_Login.backgroundColor = [UIColor clearColor];
    [Button_Login setTitle:@"Login" forState:UIControlStateNormal];                      //按钮的提示字
    Button_Login.titleLabel.font = [UIFont fontWithName:@"helvetica" size:12];           //设置字体大小
    [Button_Login setBackgroundImage:[UIImage imageNamed:@"28.png"] forState:UIControlStateNormal];  //设置背景图片
    [self.view addSubview:Button_Login];
    [Button_Login addTarget:self action:@selector(Login_Judge) forControlEvents:UIControlEventTouchDown];  //触发到函数Login_Judge中


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM