Skip to content

jinghailang/DirectionButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DirectionButton

设置button中图片和文字的相对位置

效果图(top,left,bottom,right)

使用

UIImage *downArrow = [UIImage imageNamed:@"icon_jiangjin"];
UIButton *_arrowBtn = [[UIButton alloc] initWithFrame:CGRectMake((self.view.frame.size.width-320)/2.0, 64, 320, 100)];
    
_arrowBtn.backgroundColor = [UIColor orangeColor];
_arrowBtn.titleLabel.backgroundColor = [UIColor redColor];
_arrowBtn.imageView.backgroundColor = [UIColor greenColor];
    
[_arrowBtn setTitle:@"哈哈" forState:UIControlStateNormal];
[_arrowBtn setImage:downArrow forState:UIControlStateNormal];
    
//图片在文字上面的样式
[_arrowBtn applayDirection:UIButtonDirectionTop imgTitleSpace:5];

About

设置button中图片和文字的相对位置

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published