UIKit
文章平均质量分 64
小小道生一
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
UIButton(初级)
1.按钮创建 UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(20, 100, 200, 50)];2.按钮背景 btn1.backgroundColor = [UIColor redColor];3.添加到视图 [self.view addSubview:btn1];原创 2017-07-04 00:34:33 · 254 阅读 · 0 评论 -
CocoaPods基本配置
CocoaPodsCocoaPods介绍开发iOS项目不可避免地要使用第三方框架,CocoaPods是一个负责管理iOS项目中第三方框架的工具。CocoaPods可以帮助我们快速有效的安装和更新和删除第三方框架。CocoaPods帮助我们把需要集成的第三方框架从Github安装到项目中。CocoaPods安装步骤在安装CocoaPods前,首先需原创 2017-09-02 22:27:29 · 267 阅读 · 0 评论 -
内存处理
// 内存警告处理- (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; if (self.isViewLoaded && self.view.window == nil) { self.view = nil;原创 2017-08-24 02:35:58 · 194 阅读 · 0 评论 -
UIStackView基础篇
Stack View能够将它所含的View以各种方式沿其轴向进行分布,同时也可以将View沿某个方向等距分布例://实现子控件等分 UIStackView *discountStackView = [[UIStackView alloc] init]; //设置轴向 discountStackView.axis = UILayo原创 2017-08-06 22:51:02 · 636 阅读 · 0 评论 -
UIScrollView基础篇
以下三个继承自UIScrollView: UITableView 表格视图 UICollection 集合视图 UITextView 文本视图 滚动修改原理:修改自身bounds的值, scrollView的直接子控件在添加约束时比平常情况要多加 1.要设置四边边距 2.要设置明确的宽和高原创 2017-08-06 11:00:41 · 352 阅读 · 0 评论 -
UISegmentedControl分段控件(基础篇)
1. //创建一个分段控件 NSArray *arr = [NSArray arrayWithObjects:@"亚洲",@"欧美",@"日韩",nil]; UISegmentedControl *seg = [[UISegmentedControl alloc] initWithItems:arr]; seg.frame = CGRectMake(30,原创 2017-08-03 01:09:48 · 628 阅读 · 0 评论 -
提示框(新版)
一.UIAlertView(需要按钮触发) 新建按钮 UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(50, 200, 200, 50)]; btn.backgroundColor = [UIColor redColor]; [self.view addSubview:bt原创 2017-08-08 18:37:19 · 328 阅读 · 0 评论 -
UITableView使用基础篇
使用三部曲: 1.遵守协议 2. 设置数据源 3.实现相应数据源方法#import "ViewController.h"//遵守协议@interface ViewController () UITableViewDelegate,UITableViewDataSource>{ NSArray *arra原创 2017-08-01 21:46:27 · 193 阅读 · 0 评论 -
视图控制器(入门级)
1.创建按钮(第一个视图) UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(10, 100, 100, 50)]; button.backgroundColor = [UIColor grayColor]; [self.view addSubview:button];原创 2017-06-27 23:24:26 · 195 阅读 · 0 评论 -
UILabel赋值
两种赋值方式结果一样1.self.resultLabel.text = [NSString stringWithFormat:@“%zd”,result]; %zd自动判断%d与%ld2.self.resultLabel.text = @(result).description;原创 2017-06-26 22:46:19 · 927 阅读 · 0 评论 -
UIswitch UISlider(基础篇)
//开关Switch UISwitch *sw = [[UISwitch alloc] initWithFrame:CGRectMake(100, 100, 0, 0)]; [self.view addSubview:sw]; //设置开关打开时的颜色 sw.onTintColor = [UIColor grayColor];原创 2017-07-05 00:21:45 · 227 阅读 · 0 评论 -
UIRefreshControl原生下拉刷新功能
#import "ViewController.h"@interface ViewController ()<UITabBarControllerDelegate>@property (nonatomic, strong) NSMutableArray *newsData;@end@implementation ViewController- (void)viewDidLoad { ...原创 2018-04-26 11:38:12 · 247 阅读 · 0 评论
分享