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];
时间: 2024-11-01 22:10:40