![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
按钮(Button)
st646889325
这个作者很懒,什么都没留下…
展开
-
iOS 设置button左文字右图片
定义类别#import <UIKit/UIKit.h>@interface UIButton (CustomMethods)- (void)rolloverImageTextLocation;@end#import "UIButton+CustomMethods.h"@implementation UIButton (CustomMethods)- (...原创 2020-04-08 09:16:49 · 1221 阅读 · 0 评论 -
ios button重复点击问题
#import "UIControl+Extension.h"#import <objc/runtime.h>static const char *UIControl_acceptEventInterval = "UIControl_resumeEventInterval";static const void *BandNameKey = &BandNameKey;...原创 2020-04-07 14:15:27 · 300 阅读 · 0 评论 -
类方法创建button
+ (UIButton *)creatButonWithType:(UIButtonType )type Frame:(CGRect )frame title:(NSString *)title titleColor:(UICol原创 2016-09-14 15:29:55 · 429 阅读 · 0 评论 -
UIButton的使用
UIButton是按钮视图控件,是UIView的子类,也拥有和view一样的属性,同时也有自己特有的属性;UIButton的主要作用是用来响应,或控制其他事件的发生;比如说显示,或隐藏其他控件,或调用其他函数方法。[objc] view plain copy UILabel *lable01 = [[UILabel all原创 2016-10-14 10:53:48 · 364 阅读 · 0 评论 -
iOS设置圆角及圆形图片
方方正正的样式往往会显得很生硬,而圆角的样式会让人产生别样的亲切感,现在越来越多地用到圆角,诸如用户头像之类的图片也大都用圆形来显示,本文就介绍如何设置按钮、文本框的圆角以及制作圆形的图片。先来看看效果图:如效果图所示,我们制作了一个圆形的头像,一个完全半圆的圆角按钮,一个小圆角的按钮,以及一个带边框且边框为圆角的label。大概思路如下:V原创 2016-11-11 17:15:53 · 499 阅读 · 0 评论 -
给UILabel 或者 UIButton标题加下划线
方法一:[objc] view plain copy NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"查看所有中奖记录"]; NSRange strRange = {0,[str length]}; [原创 2016-11-16 09:23:44 · 520 阅读 · 0 评论 -
UIButton中setTitleEdgeInsets和setImageEdgeInsets的使用
UIButton内有两个控件titleLabel和imageView,可以用来显示一个文本和图片,这里的图片区别于背景图片。给UIButton设置了title和image后,它们会图片在左边,文本在图片右边显示。它们两个做为一个整体依赖于button的contentHorizontalAlignment居左居右或居中显示。 1.当button.width转载 2016-11-02 09:08:09 · 223 阅读 · 0 评论 -
类方法创建控件
#pragma mark - 获取一个字符串的Size+ (CGSize )getSizeWithString:(NSString *)str WithSize:(CGSize )allowSize font:(NSInteger )font { NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphS原创 2016-11-25 14:15:46 · 273 阅读 · 0 评论 -
按钮中文字和图片位置
#import <UIKit/UIKit.h>@interface UIButton (CustomMethods)/** 图片在右,标题在左 */- (void)rolloverImageTextLocation;/** 图片在左,标题在右 */- (void)setIconInLeft;/** 图片在右,标题在左 */- (void)setIconInRi...原创 2018-12-03 08:20:11 · 647 阅读 · 0 评论