Created
June 25, 2012 14:06
-
-
Save peterlee0127/2988851 to your computer and use it in GitHub Desktop.
ios button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIColor *buttonColorDefault = [UIColor colorWithRed:90.0f/255.0f green:90.0f/255.0f blue:90.0f/255.0f alpha:1.0]; | |
UIColor *buttonColorHighlight = [UIColor colorWithRed:255.0f/255.0f green:255.0f/255.0f blue:255.0f/255.0f alpha:1.0]; | |
UIImage *btn = [UIImage imageNamed:@"Button.png"]; | |
UIImage *btnh = [UIImage imageNamed:@"ButtonHighlighted.png"] ; | |
// building the buttons | |
UIButton *aboutBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | |
[aboutBtn addTarget:self action:@selector(showAboutPage) forControlEvents:UIControlEventTouchUpInside]; | |
[aboutBtn setTitle:@"登入" forState:UIControlStateNormal]; | |
[aboutBtn setFrame:CGRectMake(80.0,320.0, 162.0, 42.0)]; | |
[aboutBtn setBackgroundImage:btn forState:UIControlStateNormal]; | |
[aboutBtn setBackgroundImage:btnh forState:UIControlStateHighlighted]; | |
[aboutBtn setTitleColor:buttonColorDefault forState:UIControlStateNormal]; | |
[aboutBtn setTitleColor:buttonColorHighlight forState:UIControlStateHighlighted]; | |
// place the button into the view | |
[self.view addSubview:aboutBtn]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment