
UIButton 按钮
小手一背爱谁谁
这个作者很懒,什么都没留下…
展开
-
iOS UIButton添加Block点击事件
#import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface UIButton (Block) - (void)addTargetEventforControlEvents:(UIControlEvents)controlEvents block:(void (^)(UIButton * button))block; @en...原创 2020-03-11 17:12:43 · 1175 阅读 · 0 评论 -
iOS 实现一个签到样式
可以随意更改每行显示的个数,并且自适应占满指定区域。 #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @class BackView; @interface ButtonView : UIView /** 传入按钮名名字数组 */ @property (nonatomic, strong) NSArray *arrName; /...原创 2019-04-22 17:51:26 · 1000 阅读 · 0 评论 -
iOS button组实现摇奖效果
#import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface YaoJiangView : UIView /** 按钮名字 */ @property (nonatomic, strong) NSArray *arr; /** 摇奖结果不是随机的 而是固定的 可以自定义摇奖结果 */ @property (no...原创 2019-01-24 15:02:00 · 266 阅读 · 0 评论 -
iOS UIButton 添加Block 一劳永逸告别addTarget
// 1 创建一个UIButton category#import <UIKit/UIKit.h>#import <objc/runtime.h>typedef void(^ButtonSenderBlock) (UIButton* sender);@interface UIButton (Block)@property(nonatomic,copy)ButtonSende...原创 2018-05-30 17:12:59 · 1833 阅读 · 0 评论 -
iOS 直接改变控件x.y.width.height
#import @interface UIView (Frame) @property (nonatomic, assign) CGFloat x; @property (nonatomic, assign) CGFloat y; @property (nonatomic, assign) CGFloat width; @property (non原创 2017-09-12 13:19:32 · 2000 阅读 · 0 评论 -
iOS 快速创建控件
#import #import @interface QuickBuild : NSObject /** 创建UILabel */ + (UILabel *)quickBuildLableWithFrame:(CGRect)frame text:(NSString *)text原创 2017-09-12 13:11:18 · 414 阅读 · 0 评论 -
iOS 设置圆角
// 设置圆角 +(void)yuanjiao:(UIView *)view Radius:(CGFloat)Radius{ [view.layer setCornerRadius:Radius]; [view.layer setMasksToBounds:YES]; }原创 2017-03-22 14:23:16 · 462 阅读 · 0 评论 -
iOS 悬浮按钮带移动置顶、拖动防越界
{ // 悬浮按钮 UIButton * moveRedPacket; } #pragma mark 创建悬浮按钮 - (void)CreatMoveRedPacketUI { if (moveRedPacket==nil) { moveRedPacket = [[UIButton al原创 2017-01-06 16:23:50 · 1226 阅读 · 0 评论 -
iOS for循环创建UIButton及点击处理
{ //声明一个全局变量判断选中的按钮 UIButton *selectedBtn; } - (void)addButton:(UIView *)view{ NSArray *arr = @[@"1",@"5",@"10",@"20",@"50"]; CGFloat w =0;//保存前一个button的宽以及前一个button距离屏幕边缘的距离 ...原创 2016-10-09 19:14:53 · 7744 阅读 · 0 评论 -
iOS Button选中与取消
/** * 潘墩是否点击 */ @property (nonatomic , assign) BOOL selected; /** * button 点击事件 选中 取消选中 */ - (void)handleButtonPress:(id)sender { NSLog(@"%d原创 2016-08-16 18:15:51 · 4368 阅读 · 0 评论 -
iOS 创建button组平均分配宽度
-(NSMutableArray *)buttonFromArrName:(NSArray <NSString *>*)nameArr ImageArr:(NSArray <NSString *>*)ImageArr selImageArr:(NSArray <...原创 2016-01-15 16:20:09 · 2789 阅读 · 0 评论