草庐IT

emailBtn

全部标签

ios - 如何将 UIButton 的标题设置为左对齐?

我需要在UIButton的左侧显示一个电子邮件地址,但它被定位到了中心。有没有办法将对齐设置为UIButton的左侧?这是我当前的代码:UIButton*emailBtn=[[UIButtonalloc]initWithFrame:CGRectMake(5,30,250,height+15)];emailBtn.backgroundColor=[UIColorclearColor];[emailBtnsetTitle:obj2.customerEmailforState:UIControlStateNormal];emailBtn.titleLabel.font=[UIFontsyst

ios - 如何将 UIButton 的标题设置为左对齐?

我需要在UIButton的左侧显示一个电子邮件地址,但它被定位到了中心。有没有办法将对齐设置为UIButton的左侧?这是我当前的代码:UIButton*emailBtn=[[UIButtonalloc]initWithFrame:CGRectMake(5,30,250,height+15)];emailBtn.backgroundColor=[UIColorclearColor];[emailBtnsetTitle:obj2.customerEmailforState:UIControlStateNormal];emailBtn.titleLabel.font=[UIFontsyst