我试图邀请Facebook用户尝试我的iOS应用程序(尚未在商店中,尚未完成).
我使用facebook API来验证用户,然后尝试使用以下代码:
- (void)shareWithFriends:(id)sender
{
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Invite Friends"
message:@"If you enjoy using this app, would you mind taking a moment to invite a few friends that you think will also like it?"
delegate:self
cancelButtonTitle:@"No Thanks"
otherButtonTitles:@"Tell Friends!", nil];
[alert show];
}
- (void)alertView:(UIAlertView *)alertView
didDismissWithButtonIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0) {
// User has clicked on the No Thanks button, do not ask again
NSLog(@"Chitty user says he doesn't wanna share");
} else if (buttonIndex …Run Code Online (Sandbox Code Playgroud) 我有一个自定义UIButton的以下代码:
btnLogin.layer.cornerRadius = 10;
[btnLogin setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"bluetint.png"]]];
[btnLogin setAlpha:1];
[btnLogin setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[btnLogin setBackgroundImage:[UIImage imageNamed:@"reallybluetint.png"] forState:UIControlStateHighlighted];
[btnLogin setBackgroundImage:[UIImage imageNamed:@"reallybluetint.png"] forState:UIControlStateSelected];
Run Code Online (Sandbox Code Playgroud)
当我突出显示按钮时,即使它在正常状态下有圆角,它也会变成平方.
有任何想法吗?