按钮对齐方式
typedef NS_ENUM(NSInteger, UIControlContentHorizontalAlignment) {
UIControlContentHorizontalAlignmentCenter = 0,
UIControlContentHorizontalAlignmentLeft = 1,
UIControlContentHorizontalAlignmentRight = 2,
UIControlContentHorizontalAlignmentFill = 3,
};
UIButton * btn_fenxiang = [ToolsFunc CreateButtonWithFrame:CGRectMake(30, 10, 40, 20) andimage:@"fenxiang" ];
[btn_fenxiang setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];
[btn_fenxiang addTarget:self action:@selector(fenxiang:) forControlEvents:UIControlEventTouchUpInside];
[rightitem addSubview:btn_fenxiang];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightitem];