
基础控件的创建
zyk_ios
这个作者很懒,什么都没留下…
展开
-
创建一个警告框
UIAlertController *alertController = [UIAlertControlleralertControllerWithTitle:@"网络异常重新加载"message:nilpreferredStyle:(UIAlertControllerStyleAlert)]; UIAlertAction *okAction = [UIAlertActionacti原创 2015-12-22 16:08:09 · 380 阅读 · 0 评论 -
创建提示语
#pragma mark 创建提示语的方法- (void)createTiShiLabel:(NSString *)text{ NSDictionary *attrs =@{NSFontAttributeName : [UIFontsystemFontOfSize:14]}; CGRect textRect = [textboundingRe原创 2015-12-22 16:12:27 · 320 阅读 · 0 评论 -
导航栏标题,返回按钮,文字图片按钮
UILabel *title = [[UILabelalloc] initWithFrame:CGRectMake(0,0, 100,44)]; title.text = self.titleText; title.textAlignment =NSTextAlignmentCenter; title.textColor = RGB(2原创 2015-12-22 16:14:50 · 441 阅读 · 0 评论 -
UIPageControl
/** * 添加pageControl */- (void)setupPageControl{ // 1.添加 UIPageControl *pageControl = [[UIPageControlalloc] init]; pageControl.numberOfPages = NewfeatureImageC原创 2015-12-22 17:27:45 · 227 阅读 · 0 评论 -
点击键盘周边退出键盘
#pragma mark 点击键盘周边退出键盘[selfsetUpForDismissKeyboard];//退出键盘- (void)setUpForDismissKeyboard { NSNotificationCenter *nc = [NSNotificationCenterdefaultCenter]; UITapGestur原创 2015-12-22 17:31:03 · 234 阅读 · 0 评论 -
导航栏边线及背景图片设置
self.navigationController.navigationBar.shadowImage = [[UIImagealloc] init]; [self.navigationController.navigationBarsetBackgroundImage:[[UIImagealloc] init]forBarMetrics:UIBarMetrics原创 2015-12-22 17:43:37 · 1028 阅读 · 0 评论 -
通知传值
首先,我们在需要接收通知的地方注册观察者//获取通知中心单例对象 NSNotificationCenter * center = [NSNotificationCenter defaultCenter]; //添加当前类对象为一个观察者,name和object设置为nil,表示接收一切通知 [center addObserver:sel原创 2016-02-20 11:04:56 · 271 阅读 · 1 评论