I need 0.5 space, showing a UILabel
.
Like to set a button's title as the following image:
Here is what I achieved:
There is a small difference between the two button's layout. Here is my code:
UIButton * tmpBtn = [[UIButton alloc] initWithFrame: CGRectMake(200, 200, 84, 26)];
[tmpBtn setBackgroundImage: [UIImage imageNamed: @"btnBgImage"] forState: UIControlStateNormal];
[tmpBtn setTitle: @"1 跳过" forState: UIControlStateNormal];
// there is 3 space
tmpBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
tmpBtn.contentEdgeInsets = UIEdgeInsetsMake(0, 8, 0, 0);
[self.view addSubview: tmpBtn];
There is 3 space in the text. I need 2.5 space.
Is there anyway to achieve it?