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