我创建了一个像这样的uibutton:
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
button.frame = CGRectMake(280, 320, 100, 30);
[button setTitle:@"World" forState:UIControlStateNormal];
[button addTarget:self action:@selector(button:) forControlEvents:UIControlEventTouchUpInside];
button.backgroundColor= [UIColor clearColor];
[cell.contentView addSubview:button];
按钮的文字看起来很锋惠,有人知道为什么吗?
答案 0 :(得分:0)
更改
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
到
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
^^^^^^
一切都会好..
答案 1 :(得分:0)
尝试给予Font:
// Configure the cell...
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
button.frame = CGRectMake(0, 0, 100, 30);
[button setTitle:@"World" forState:UIControlStateNormal];
[button addTarget:self action:@selector(button:) forControlEvents:UIControlEventTouchUpInside];
button.titleLabel.font=[UIFont fontWithName:@"HelveticaNeu-CondensedBold" size:16];
button.backgroundColor= [UIColor clearColor];
[cell.contentView addSubview:button];