直播带货源码,图片左上角或右上角点击返回按钮
直播带货源码,图片左上角或右上角点击返回按钮实现的相关代码
[btn_off setImage:[UIImage imageNamed:@"hifi_off"] forState:(UIControlStateNormal)];
[btn_off addTarget:self action:@selector(bgAction) forControlEvents:(UIControlEventTouchUpInside)];
btn_off.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
btn_off.contentVerticalAlignment = UIControlContentVerticalAlignmentBottom;
btn_off.backgroundColor = UIColor.greenColor;
[contentView addSubview:btn_off];
其中 btn_off.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; 为图片居左
btn_off.contentVerticalAlignment = UIControlContentVerticalAlignmentBottom; 为图片置底
以上就是 直播带货源码,图片左上角或右上角点击返回按钮实现的相关代码,更多内容欢迎关注之后的文章