IOS 改变按钮标题位置和缩进

来源:互联网 发布:网络协议是指 编辑:程序博客网 时间:2024/05/21 17:34


UIButton *missGesturebtn = [UIButton buttonWithType:UIButtonTypeCustom];missGesturebtn.frame = CGRectMake(0, CGRectGetMaxY(_editGesturebtn.frame)+20, SCREEN_WIDTH, 40);[missGesturebtn setTitle:@"忘记手势密码" forState:UIControlStateNormal];[missGesturebtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];missGesturebtn.backgroundColor = [UIColor whiteColor];missGesturebtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;//左对齐missGesturebtn.titleEdgeInsets = UIEdgeInsetsMake(0, 20, 0, 0);//上,左,下,右[missGesturebtn addTarget:self action:@selector(missGesture) forControlEvents:UIControlEventTouchUpInside];[self.view addSubview:missGesturebtn];


0 0
原创粉丝点击